G
gnewsgroup
I am wondering what's considered the best practice error handling in
asp.net.
I know that each application is different and thus has different
requirement. So, let's say in general what is considered the best.
1. I know that we can handle errors in the catch block. But, I think
it is a lot of hassle to handle each exception separately.
2. I know that we can handle an exception of a particular page in the
Page_Error method or specify a file for the ErrorPage property in the
Page directive of an aspx page.
3. It is also possible to handle an exception in the Application_Error
method of global.asax file.
4. Finally, at the highest level, an exception can be handled by
specifying a redirect file for the customErrors element in web.config.
My question is this:
since we can handle an exception at the page, application level, is it
necessary to handle it in the catch block?
Thanks.
asp.net.
I know that each application is different and thus has different
requirement. So, let's say in general what is considered the best.
1. I know that we can handle errors in the catch block. But, I think
it is a lot of hassle to handle each exception separately.
2. I know that we can handle an exception of a particular page in the
Page_Error method or specify a file for the ErrorPage property in the
Page directive of an aspx page.
3. It is also possible to handle an exception in the Application_Error
method of global.asax file.
4. Finally, at the highest level, an exception can be handled by
specifying a redirect file for the customErrors element in web.config.
My question is this:
since we can handle an exception at the page, application level, is it
necessary to handle it in the catch block?
Thanks.