Custom error handling

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)?
 
E

Eric Marvets

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top