在用户单击 ajaxfileupload 控件的上传按钮后,我正在尝试对页面上的其他一些字段进行一些验证。OnClientUploadStart 被定义为在上传开始之前触发。它有效。但如果验证失败,我想取消上传。我试着做“return false;” 但这没有用。如何取消上传?
如果验证失败,那么我想取消
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"/>