Error Handling in asp.net mvc 3

后端 未结 5 1485
闹比i
闹比i 2020-12-08 04:32

Is there a built in or a proper way to handle errors in asp.net mvc 3?

This is what I want to do:

  1. If the application crashes, or throws an error, it go
5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-08 04:57

    I think the easiest way is using ExceptionHandler attribute since it's ready to use anytime you create a new ASP.NET MVC 3 project. You can still configure Web.config to use a custom error page and handling exceptions in global Application_Error method as usual but when an exception occurs the URL is not displayed as nice as the new MVC 3's way.

提交回复
热议问题