我有一个带有生成帮助区域的ASP.NET-Web-API项目。我想将主页路由到指向帮助页面。如何才能做到这一点? 我试图修改区域注册,如下所示,但它无法正常工作
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"HomePage",
"{controller}/{action}/{id}",
new { controller = "Help", action = "Index", apiId = UrlParameter.Optional });
context.MapRoute(
"HelpPage_Default",
"Help/{action}/{apiId}",
new { controller = "Help", action = "Index", apiId = UrlParameter.Optional });
HelpPageConfig.Register(GlobalConfiguration.Configuration);
}