On a root page in my project I have a number of different country services gathered by category all on one page. The Category is the "Index" page in the View folder in a separate area, and the particular service is the "Details" view. I want the user to be able to jump straight past the category in the (in this case China) area to that particular services detail.
I have this:
<%=Html.ActionLink("More Info", "Details", "ParticularChinaServiceControllerName", new { area = "China" }, new { id = p.ID })%>
but the framework will not pick up the id.
The route is registered as: public override string AreaName { get { return "China"; } }
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"China_default",
"China/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
);
}
}
Can someone show me how to make this work correctly?