c# - How can I cancel ajaxToolkit:AjaxFileUpload inside OnClientUploadStart? -


i'm trying validation of other fields on page after user clicks upload button of ajaxfileupload control. onclientuploadstart defined fire before upload starts. , works. want cancel upload if validation fails. tried doing "return false;" didn't work. how can cancel upload?

if validation fails want cancel

 function uploadstart(sender, args) {              var filedescription = document.getelementbyid("filedescription").value;              alert( filedescription);          return false;          }   <ajaxtoolkit:ajaxfileupload id="ajaxfileupload1"     throbberid="mythrobber" onuploadcomplete="ajaxfileupload1_uploadcomplete"     contextkeys="" onclientuploaderror="uploaderror" onclientuploadcomplete="uploadcomplete" onclientuploadstart="uploadstart"      allowedfiletypes="jpg,jpeg,doc,xls"     maximumnumberoffiles="1"     runat="server"/>   

to start uploading manually can use script:

function startupload(){     $get("<%= ajaxfileupload1.clientid %>_uploadorcancelbutton").click(); } 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -