I have just deployed an MVC4 .NET 4.0 app to my web host, for \'live\' deployed testing. Non -area routes are working fine, e.g. my
@Html.ActionLink(\"Regis
-
In your case because you specify area in query string, the routes from Global.asax.cs should apply. I belive you have something like this there:
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
).DataTokens.Add("area","Author");
}
This code makes Home/Index default route and skips Home/Index in url. If you change controller = "Home" on something else for example controller = "Home2" you will have displayed full link for Home/Index and new default route Home2/Index. Similar apply to default routes in areas if you have them specified.
- 热议问题