开发者

handling exceptions IN Action Filters

Is there a better way to handle exceptions that occur inside an Action Filter itself in ASP .NET MVC?

There're 2 ways I can think of at the moment.

  1. Using a try catch and setting the HTTP Status Error code and message directly when an exception occurs
  2. Response.Redirect to the custom error page
  3. 开发者_开发问答


You may implement IExceptionFilter to separate exception handling from the rest of the filter logic.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜