我在我的webform中使用Ajax Control工具包中的AjaxFilUpload。我想检查文件大小和cancelUpload,如果它已超过一定的大小。我已经在OnClientUploadStart& OnClientUploadComplete,但在这样做之后,文件仍然在页面上显示Uploaded。
网络表单:
<div>
<ajaxToolkit:AjaxFileUpload ID="AjaxFileUpload1" runat="server" OnUploadComplete="AjaxFileUpload1_UploadComplete" OnUploadStart="AjaxFileUpload1_UploadStart"
OnClientUploadCompleteAll="onUploadCompleteAll" OnClientUploadComplete="onUploadComplete" OnClientUploadStart="onUploadStart" />
</div>
使用Javascript:
function onUploadStart(sender, args) {
sender.cancelUpload();
}
function onUploadComplete(sender, args) {
sender.cancelUpload();
}
的Web.config:
<handlers>
<add name="AjaxFileUploadHandler" verb="*"
path="AjaxFileUploadHandler.axd"
type="AjaxControlToolkit.AjaxFileUploadHandler,
AjaxControlToolkit"/>
</handlers>
如何取消上传?