I created an ASP.NET MVC project and everything works fine, but I have one problem with routing. My Global.asax looks like this:
public static void RegisterRoutes(RouteCollection routes) {
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
);
}
So, nothing out of the ordinary. My problem is that when I contact the controller / action / params with HTML.ActionLink as follows:
<%= Html.ActionLink("My link", "SomeAction", "SomeController", new {param="someParam"})%>
it must generate (at least, it makes sense in my head) link, such as: http://www.localhost/SomeController/SomeAction/someParam.
Instead, this link is created: http://localhost/SomeController/SomeAction?param=someParam
If I manually create a link that refers to the expected result (SomeController / SomeAction / someParam), the right controller and action are called, but the parameter defined in the action method is always zero.
Any ideas?