In my ASP.NET MVC 3, I am using this code
<a href=@url.Action("myController", "myaction")>
But when I click on it, it does't go to my action. Instead, in the URL I see this
http://localhost:1402/?Length=2
Am I missing something?
Thanks.
Edit :
Here are my routes :
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
the first argument is interpretted as the Action
@url.Action("myaction","myController")