我正在创建一个 ASP.NET 网站,并且正在使用 AJAX 控件工具包“AsyncFileUpload”控件,我只想将一个值传递给onclientuploadcomplete
客户端事件,并且我想在从UploadedComplete
服务器事件中保存文件后执行此操作。
这是我目前的AsyncFileUpload
:
<asp:AsyncFileUpload ID="AsyncFileUpload2" runat="server" CssClass="fileupload" onclientuploadstarted="uploadStarted"
UploadingBackColor="#CCFFFF" Width="221px"
onclientuploaderror="upload_error" ClientIDMode="AutoID"
onclientuploadcomplete="done_uploading" />
她是我当前的 Javascript 代码:
</script>
<script language="javascript" type="text/javascript">
var baseUrl = "<%= ResolveUrl("~/") %>";
function done_uploading(THE_VALUE) {
//TODO: ALERT THE_VALUE
}
function uploadStarted(sender, args) {
var file = args.get_fileName();
var extensions = "7z";
if (!new RegExp("(" + extensions + ")$").test(file)) {
throw (new Error());
} else {
// show_loading();
}
}
function upload_error() {
}
</script>