I am rendering a menu from a Partial Action directly to the layout, using:
@Html.Action(MVC.Menu.Index())
This action, determines which Men
Something strange is going on here, and I wonder if there is some kind of MVC bug at the root. Even without using T4MVC, this happens if you write:
@Html.ActionLink("Welcome", "Index", "Home", new { Area = "" }, null)
In a regular view, this doesn't generate the bogus ?Area=, while in a Html.Action call it does. I need to ask someone on the team.
For now, you can workaround by deleting this line (around line 310) in t4mvc.tt:
<# if (MvcVersion >= 2) { #>result.RouteValueDictionary.Add("Area", area ?? "");<# } #>
I solve this issue in a very easy way, simply by adding to all routes that are not in area empty area route like this:
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", area = "", id = UrlParameter.Optional });