ASP.NET C# Catch all exceptions in a class

前端 未结 5 701
我在风中等你
我在风中等你 2021-01-30 12:05

I know this is not the way to do it, and it isn\'t clean at all. I just wonder if it\'s possible.

If I have a class with a bunch of methods

public class          


        
5条回答
  •  佛祖请我去吃肉
    2021-01-30 12:33

    By default, in ASP.NET you can override the OnError method and then do Server.ClearError to dispose of the exception.

    I'm not sure if it applies to your case (only works in Page and Global.asax)

提交回复
热议问题