例如这个AsyncFileUpload,有一个事件“OnClientUploadComplete”
我可以做类似的事情吗
$("#ctl00_MainContent_AsyncFileUpload1_ctl02")
.bind("OnClientUploadComplete", function () { alert("test");
})
<ajaxToolkit:AsyncFileUpload OnClientUploadComplete="uploadComplete" runat="server" ID="upload" Width="400px" UploaderStyle="Modern" CompleteBackColor="White" UploadingBackColor="#CCFFFF" ThrobberID="imgLoader" OnUploadedComplete="AsyncFileUpload1_UploadedComplete" OnClientUploadStarted = "uploadStarted" /> <asp:Image ID="imgLoader" runat="server" ImageUrl="~/images/loader.gif" /><br /><br /> <img id = "imgDisplay" alt="" src="" style = "display:none"/>
$addHandler($("#<%=upload.ClientID %>"), 'uploadComplete', (function () { alert("test"); })); function uploadStarted() { $get("imgDisplay").style.display = "none"; } function uploadComplete(sender, args) { var imgDisplay = $get("imgDisplay"); imgDisplay.src = "images/loader.gif"; imgDisplay.style.cssText = ""; var img = new Image(); img.onload = function () { imgDisplay.style.cssText = "height:100px;width:100px"; imgDisplay.src = img.src; }; img.src = "<%=ResolveUrl(UploadFolderPath) %>" + args.get_fileName(); } </script>