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
Post a Comment