You need to intercept the error, either in Global. Asax or a custom IHttpModule implementation as follows: public class UnhandledExceptionHandlerModule : IHttpModule { private HttpApplication application; public void Init(HttpApplication application) { this. Application = httpApplication; this.application.
Error += Application_Error; } public void Dispose() { application = null; } protected internal void Application_Error(object sender, EventArgs e) { application. Transfer("~/Error. Aspx"); } } Then, in Error.aspx.Cs: protected void Page_Load(object sender, EventArgs e) { Response.
StatusCode = 500; // Prevent IIS from discarding our response if // / is configured. Response. TrySkipIisCustomErrors = true; // Send error in email SendEmail(Server.GetLastError()); // Prevent ASP.
NET from redirecting if // / is configured. Server.ClearError(); }.
I have an application hosted on IIS7 running in Integrated mode. I'm handling errors by putting the following into Web. I want to automatically send emails every time an exception is generated.
But the problem is that within Error. Aspx I can't figure out how to get a reference to the exception. But it returns Nothing.
I also tried HttpContext.Current.Error() and HttpContext.Current.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.