Custom error handling

  • Thread starter Thread starter Dave Bartlett
  • Start date Start date
D

Dave Bartlett

How would I go about handling errors in ASP.NET applications such that an
email is automatically sent to system admin with full details of the error
on the page (regardless of whether it was a compiler or runtime error)?
 
You could use the Application_Error event in the global.asax file to capture
the event and use Server.GetLastError to get the particular error. You
could then use ClearError to clear out the error and redirect to a custom
page. You can also accomplish the same thing, as far as redirection, from
the web.config file.


--
Eric Marvets
Principal Consultant

the bang project

<shameless self promotion>

Email (e-mail address removed) for Information on Our Architecture and
Mentoring Services

</shameless self promotion>
 
Back
Top