Hello. I have been following Pro ASP.NET MVC 4 book by Adam Freeman, and i'm confused about the ActionLink's route matching behaviour. Below are my RegisterRoute and ActionLink method :
public static void RegisterRoutes(RouteCollection routes) {
routes.MapRoute("NewRoute", "App/Do{action}",
new { controller = "Home" });
routes.MapRoute("MyRoute", "{controller}/{action}/{id}",
new { controller = "Home", action = "Index",
id = UrlParameter.Optional });
}
@Html.ActionLink("This is an outgoing URL", "CustomVariable")
The ActionLink above points to
<a href="/App/DoCustomVariable">This is an outgoing URL</a>
I find that puzzling. According to the routing rules, it shouldn't match with
/App/DoCustomVariable
since it lacks the static fragment for it. It should point to /Home.
Thanks in advance.