I don't know whether I'm just stupid (don't answer that!) or I'm fighting MVC routing but I have another problem.
In my Controller I do a RedirectToRoute("ErrorRoute") which renders a 404 View which has a MasterPage.
In the MasterPage I have a top navigation which has links such as /homepage and /news but when I am in the 404 View the navigation is /error/homepage and /error/news.
I have changed my route in Global.asax from this
routes.MapRoute(
"ErrorRoute", // Route name
"Error/Error404", // URL with parameters
new { controller = "Error", action = "Error404" }
);
to this
routes.MapRoute(
"ErrorRoute", // Route name
"Error/Error404", // URL with parameters
new { controller = "Error", action = "Error404" }
, new { action = "Error404" }
);
to see if that would help but I get a "No route in the route table.." error when I call RedirectToRoute
Can you please help?