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)
{
    _log.Error(ex);

    // http://msdn.microsoft.com/en-us/library/z9h4dk8y.aspx
    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

Windows.CustomException
Windows.Log4net?
AspDotNet.Logging
Windows.Logging