在我的web.config我已经包括了:现在死亡的黄色屏幕不再显示的HandleError属性没有任何效果
<customErrors mode="On" />
。 我想我必须包含的HandleError属性我控制器的方法或类本身:
[HandleError]
public ActionResult About()
{
throw new Exception("Just an exception");
return View();
}
但它不会有任何影响,这是一样的:
public ActionResult About()
{
throw new Exception("Just an exception");
return View();
}
在这两种情况都会显示自定义错误页面。那么HandleError属性是什么呢?
一个优秀和简洁的解释,也回答了这个问题:“RegisterGlobalFilters'的目的是什么? – Dan