views:

1691

answers:

3

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.

A: 

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

 var modalPopupBehavior = $find('popupID');
 modalPopupBehavior.hide();
stimms
+1  A: 

You can check this link which clears it with Javascript

Bcelik
A: 

Set up attribute of AsyncFileUpload descriptor to OnClientUploadComplete="UploadComplete" and use next JS:

function UploadComplete(sender, arg2) {
  // clear file
  var fileInputElement = arg1.get_inputFile();
  fileInputElement.value = "";
}

You can apply any actions/styles to the "fileInputElement" too.

chapluck