Error page is not getting displayed. Below is my configuration.
[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>
I have placed "error" and "Notfound" views in "Error" folder. However, "Notfound" view is getting displayed if I type in invalid url. But for the arithmetic exception, default error page is not getting displayed, only blank page is displayed with same url. Could you anyone please suggest.
Copyright Notice:Content Author:「Sunny」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/12696930/error-page-is-not-getting-displayed