I am trying to configure an ErrorController in my .NET MVC application, and I am unable to hit any actions on the controller currently, so I believe it may be because I need to register the URL route in the global.asax
The Error controller is the following:
public class ErrorController: Controller
{
/*Default Redirect Error Page*/
public ActionResult Index()
{
return View();
}
/*Generic Error Page*/
public ActionResult Generic()
{
return View();
}
/*Status Code: 400*/
public ActionResult NotFound()
{
return View();
}
}
I would like to be able to call the actions above by the following URL's respectively.
~/Error/
~/Error/Generic
~/Error/NotFound
I would believe that in the Global.asax file I would need to register these routes using something like the following:
routes.Add(new Route("error/{action}", new MvcRouteHandler())){controller = "Error", action = "";
How would I add/specify the correct route handler for this?