views:

479

answers:

3

We are working on exception handling with ASP.NET web applications (with C# language). Would you please let me know the best practices of Exception handling?

+6  A: 

One thing you might want to look at is ELMAH. Other than that the MSDN docs is a good place to start.

RichardOD
+1 Elmah!! For The Win
Daniel Elliott
Yes, Elmah + a custom errors page (`<customErrors mode="RemoteOnly" defaultRedirect="AppErrors.aspx">`) + don't have empty `catch` blocks.
Greg
A: 

Look at MS Enterprise Library and The Exception Handling Application Block too.

Tadas
+1  A: 

You can use the Application_Error function in Global.asax to catch and handle all exception errors in your ASP.NET application.

Check this Microsoft Help article http://support.microsoft.com/kb/306355 and scroll to where it says "How to use the Application_Error method".

RoyalCrown