There is one button(MyButton). OnClick of this button a modalpopup(MyPopup) appears with one asyncfileupload ajax control, Ok button and Cancel button.
The browse functionality of the asyncfileupload functionality is working fine, No problem. But after postback, if I click the MyButton again, the popup appearing with the previous path in the asyncfileupload control's textbox.
How to clear it ... !
Thanks in advance.
this worked for me if you're attempting to clear it client side.
None of the proposed ways worked for me. The problem is not specific to
AsyncFileUpload
, but to theinput[type=file].
Finally, I found a way that worked for me with javascript:
This is a correction for the Jmoon's answer. This is usefull if you want to clear AsyncFileUpload text not after upload complete but after some other user action.
Set up attribute of AsyncFileUpload descriptor to OnClientUploadComplete="UploadComplete" and use next JS:
You can apply any actions/styles to the "fileInputElement" too.
This will definitely clear the textbox:
Assuming you're using the control from Ajax Control Toolkit you can hook into the OnClientUploadedComplete handle which is called on the client side once the upload is complete. You want to call hide on the modal popup