ASP.Net Page Method Errors Not Occurring?

I can't figure out why an exception from a static method of an ASP.Net page doesn't escalate into an Application_Error event that should be handled in the global.asax file. I don't expect any errors, but I would like to be safe and aware of them if they happen, and would rather not wrap every static method in a try ... catch.

Does anyone know how to catch these exceptions, or at least why they aren't boiling?

0


a source to share


2 answers


Bubble exception to error handler in Application_Error if they are not handled in lower layers. If you already have a TRY / CATCH block in which you think it is an exception, it will be caught at that point.



Please post your static method code and your Application_Error. This will make it easier to provide you with an exact answer instead of a generalized one.

+1


a source


If you are developing with Visual Studio, you should debug your code and then step through the source to find the exception and see what catches it before going to your Application_Error method.



0


a source







All Articles