About Exceptions in ASP.NET

  • Thread starter Thread starter Anders Both
  • Start date Start date
A

Anders Both

Does someon know if it is possible to make a setup in the asp.net process so
that some special c# method is called whenever a uncauht exception is
thrown.

Something like Application.ThreadException, in windows form.

Please be aware that I cannot use :

<customErrors defaultRedirect="url" redirect="url"/>

Because I have threads and Asynchronous methods running in my asp.net
process.

But maybe I can use somthing else ?

Best Regards, Anders Both, Denmark
 
Handle the Application_Error event in global.asax. This will get called
whenever there is an unhandled exception thrown.
 
Find this in the global.asax file:

protected void Application_Error(Object sender, EventArgs e)

{

}



Not the best place for a simple redirect, but very useful for processing
errors, esp. for error tracing.


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
Back
Top