2
Reply

How To Handle Exception in Asp.Net ?

    There are three ways to handle exceptions/errors in ASP.NET:

    1. try-catch block. This is also called Structured Exception Handling (SEH).
    2. Error Events.
    3. Custom Error Page.

    We can catch and handle errors at three levels

    1. At the method level by using try...catch blocks for performing exception handling.

    2.At the page level by using Page.Error event.Any error on the page - except for those within try...catch blocks will raise this event.

    3.At the application level by:  
       a) Using the Application_Error event in a global.asax file.
       b) Using the web.config file .Any error within the application that are not handled by the               previous methods will display the error handling page.