如何清除asyncfileupload的文本框值?

Ami*_*mit 4 .net ajax modalpopupextender asyncfileupload

有一个按钮(MyButton).单击此按钮会出现一个modalpopup(MyPopup),其中包含一个asyncfileupload ajax控件,"确定"按钮和"取消"按钮.

asyncfileupload功能的浏览功能正常,没问题.但是在回发之后,如果我再次单击MyButton,弹出窗口将出现在asyncfileupload控件的文本框中的上一个路径中.

如何清除它......!

提前致谢.

ado*_*-mg 5

所提出的方法都不适合我.这个问题不是特定的AsyncFileUpload,而是针对的input[type=file].

最后,我找到了一种适用于javascript的方式:

function uploadComplete(sender, args) {
    jQuery(sender.get_element()).find("input[type='file']")[0].form.reset();
}
Run Code Online (Sandbox Code Playgroud)


sti*_*mms 0

假设您使用 Ajax Control Toolkit 中的控件,您可以连接到 OnClientUploadedComplete 句柄,上传完成后客户端会调用该句柄。您想在模态弹出窗口上调用 hide

 var modalPopupBehavior = $find('popupID');
 modalPopupBehavior.hide();
Run Code Online (Sandbox Code Playgroud)