In my uploadError javascript function for AsyncFileUpload from AJAX toolkit, I have the following code snippet:
function uploadError(sender, args) {
document.getElementById("<%# uploadResult.ClientID %>").innerText = args.get_fileName(), "<span style='color:red;'>" + args.get_errorMessage() + "</span>";
}
Unfortunately, when the ClientID
call returns Null
, the javascript encounters errors.
I also noticed that after the page loads, none of my controls have the usual .NET format. For example:
<asp:Label runat="server" Text="Select an image to upload it to this stock item...." ID="uploadResult" />
Typically, it would render like this:
<span id="ctl00_ContentPlaceHolder1_uploadResult">Choose a webstock file to upload...</span>
However, with this particular file, it is rendering as:
<span id="uploadResult">Select an image to upload it to this stock item....</span>
I suspect this might be the same issue, but I am unsure why it's occurring.