ASP.NET MVC Html.RouteLink
- by gilbertc
I am trying to understand what this RouteLink does. Say, in my Global.asax, I have the default route for MVC
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
and on a View page, I do
<%=Html.RouteLink("Dinners", "Default", new { controller="Dinners", action="Details", id="1"} %>
Why it does not generate the link /Dinners/Details/1 but thrown an exception?
Thanks.
Gil.