ASP.NET MVC Html.RouteLink

Posted by gilbertc on Stack Overflow See other posts from Stack Overflow or by gilbertc
Published on 2010-03-18T21:47:21Z Indexed on 2010/03/18 21:51 UTC
Read the original article Hit count: 1269

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about ASP.NET