0
錯誤頁未顯示。以下是我的配置。錯誤頁未顯示
[HttpGet]
public ActionResult Index(string name)
{
throw new ArithmeticException();
}
//Handle Error attribute
public override void OnException(ExceptionContext filterContext)
{
//logging
filterContext.ExceptionHandled = true;
base.OnException(filterContext);
}
<customErrors mode="On" defaultRedirect="~/Error">
<error statusCode="404" redirect="~/Error/NotFound"/>
</customErrors>
我已經把「錯誤」和「錯誤」文件夾「NOTFOUND」的意見。但是,如果我輸入無效的網址,則會顯示「Notfound」視圖。但是對於算術例外,默認錯誤頁面沒有得到顯示,只有空白頁面以相同的URL顯示。你可以請任何人建議。
謝謝。是的,那是缺少聲明。 – Sunny