Reputation: 5886
Why is this
<%=Html.ActionLink("Users", "Index", "Users", new { id = "3" })%>
Pointing to this
http://localhost:1798/Users/Index?Length=8
Instead of this
http://localhost:1798/Users/Index/3
Registered Routes Method:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Users", action = "Index", id = "" } // Parameter defaults
);
}
Upvotes: 0
Views: 64
Reputation: 8324
It should be:
<%= Html.ActionLink("Users", "Index", new {Id=3})
Upvotes: 2