I want a custom error page shown for 500, 404 and 403. Here\'s what I have done:
Enabled custom errors in the web.config as follows:
In web.config add this under system.webserver tag as below,
and add a controller as,
public class ErrorController : Controller
{
//
// GET: /Error/
[GET("/Error/NotFound")]
public ActionResult NotFound()
{
Response.StatusCode = 404;
return View();
}
[GET("/Error/ErrorPage")]
public ActionResult ErrorPage()
{
Response.StatusCode = 500;
return View();
}
}
and add their respected views, this will work definitely I guess for all.
This solution I found it from: Neptune Century