我在来自 AJAX 工具包的 AsyncFileUpload 的 uploadError javascript 函数中有以下内容:
function uploadError(sender, args) {
document.getElementById("<%# uploadResult.ClientID %>").innerText = args.get_fileName(), "<span style='color:red;'>" + args.get_errorMessage() + "</span>";
}
不幸的是ClientID
调用返回Null
,所以 javascript 错误。
我还注意到,一旦加载页面,我的控件都没有通常的 .NET 格式:EG:
<asp:Label runat="server" Text="Select an image to upload it to this stock item...." ID="uploadResult" />
通常会这样渲染:
<span id="ctl00_ContentPlaceHolder1_uploadResult">Choose a webstock file to upload...</span>
但是有了这个文件,它呈现为:
<span id="uploadResult">Select an image to upload it to this stock item....</span>
我认为这是同一个问题,但不知道为什么会这样。