0
当创建新的MVC3项目时,默认情况下,在GLobal.asax中将[HandleError]属性注册为GlobalFilter。但是,如果我对它进行注释并执行以下操作(在自定义错误模式下),它仍然有效。我看到ErrorView与ErrorInfo模型填充。那么在Global.asax中注册HandleError需要什么?为什么要在global.asax中注册HandleError
[HandleError(ExceptionType = typeof(NullReferenceException),View = "ErrorView")]
public ActionResult Index()
{
throw new NullReferenceException();
return View();
}