Why does:
<%= Html.ActionLinkForAreas<UsersController>(c => c.User(), "My Details") %>
Generate an URL containing this:
Users/User
But:
<%= Html.ActionLinkForAreas<BlaController>(c => c.Index(1), "My Bla Di Bla")%>
An URL like this:
Bla
Rather than this:
Bla/Index
In other words why is the Index action ‘swallowed’. Does this have to do with the routing which looks like this:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
routes.RouteExistingFiles = true;
routes.IgnoreRoute("Content/{*wildcard}");
routes.IgnoreRoute("Scripts/{*wildcard}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
Or is there another reason? How can I change this behaviour? Thanks.
Best wishes,
Christian