I am using Asp.Net's AJAX implementation and need to do two additional things when an unhandled exception occurs:
- Log any unhandled exceptions using ELMAH
- Return a message back to the page
I am inserting the AJAX script into the page using the following code:
ClientScriptManager cm = Page.ClientScript;
String cbReference = cm.GetCallbackEventReference(this, "arg",
"receiveData", "");
String callbackScript = "function sendData(arg, context) {" +
cbReference + "; }";
cm.RegisterClientScriptBlock(this.GetType(),
"sendData", callbackScript, true);
How do I configure it so that it also accounts for unhandled exceptions? Btw, ELMAH is already installed on my website and correctly logs exceptions from regular postbacks.
Thanks.