About Exceptions in ASP.NET

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
 
M

Marina

Handle the Application_Error event in global.asax. This will get called
whenever there is an unhandled exception thrown.
 
C

Cowboy \(Gregory A. Beamer\)

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!
**********************************************************************
 

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

Top