Ive been reading about trapping .Net errors at page and application level and cant decide what best suites what I want to do.
All I want is a basic redirect to a page telling the users an error has occured, no matter what the error or what page its happened on (there will be some logging going on as well).
Should this be application level?
thanks
You can add the
customErrorsattribute to the web.config. It will redirect to specified pages on error:Further more, configure a logging framework that can help you storing error information for later analysis. Here are a few frameworks: ELMAH, log4net, CuttingEdge.Logging. I would advice you to use one of these frameworks instead of fiddling around in the
Application_Errorevent and writing log functionality yourself.