Hi,
I have used "AjaxFileUpload" control.
<asp:AjaxFileUpload ID="AjaxFileUpload" MaximumNumberOfFiles="1" ContextKeys="KeyHiddenField" OnUploadComplete="AjaxFileUpload_OnUploadComplete"
OnClientUploadComplete="OnClientUploadComplete" OnClientUploadError="OnClientUploadErrorTest" runat="server" />
In code behind
protected void AjaxFileUpload_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
// want to fire "OnClientUploadError" javascript event here explicitely.
throw new NullReferenceException();
}
Javascript :
function OnClientUploadErrorTest(sender, args) {
}
OnClientUploadComplete is firing properly.
For testing i want to fire OnClientUploadError event in JavaScript for that I have explicitly thrown exception in code behind.
But it’s not firing at all.