I am trying to setup a custom 404 error page. In my web.config I have this in my system.web
<customErrors mode="RemoteOnly">
<error statusCode="404" redirect="~/Home/Error404" />
</customErrors>
I have this method in my HomeController
public ActionResult Error404()
{
return View();
}
and this my view
@{
ViewBag.Title = "Error404";
}
<h2>Error404</h2>
My problem is when I goto the URL that does not exist in my website, I do not get my custom page. Is there something I am missing?