From xradiograph

AspDotNet: Error Handling

TODO: find notes on dumping errors into log, and only returning a GUID to the user, with instructions to contact support with the error# (then map it to the log)


Passing back via javascript

I found the following to work, found via StackOverflow
This particular implementation relies on jGrowl to do the heavy-lifting for fancifying the message-display
window.parent is called, here, because the page is in an iframe


catch (Exception ex)

    var cs = Page.ClientScript;
    var cstype = this.GetType();

    var msg = string.Format(@"window.parent.$.jGrowl('ExcelExport error: ' + unescape('{0}'));", System.Security.SecurityElement.Escape(ex.Message));
    cs.RegisterStartupScript(cstype, "testscript", msg, true);


See Also


Retrieved from
Page last modified on September 05, 2013, at 09:59 AM