asp.net-mvc-4 – ASP.NET帮助页面默认主页?

我想去http:// myserver并且能够获得帮助页面作为认的主页,所以http:// myserver的第一件事就是帮助页面

我有一个认路由设置如下:

public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

    routes.MapRoute(
        name: "Default",url: "{controller}/{action}/{id}",defaults: new { controller = "Home",action = "Index",id = UrlParameter.Optional }
        );
}

然后我有我的帮助页面注册设置如下:

public override void Registerarea(AreaRegistrationContext context)
{
    context.MapRoute(
        "HelpPage_Default","doc/{action}/{apiId}",new { controller = "Help",apiId = UrlParameter.Optional });

    HelpPageConfig.Register(GlobalConfiguration.Configuration);
}

当我将RouteConfig的控制器更改为“帮助”时,我得到:

The view ‘Index’ or its master was not found or no view engine
supports the searched locations

当我将帮助页面路由更改为“{controller} / {action} / {apiId}”时,我的AttributeRoutes停止工作。

有没有一些简单的方法来使ASP.NET帮助页面认主页?

解决方法

我用以下RouteConfig完成了这个。我也使用ASP.Net帮助页面从内联XML注释自动生成我的文档:
public class RouteConfig
{
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        // By default route the user to the Help area if accessing the base URI.
        routes.MapRoute(
            "Help Area","",action = "Index" }
        ).DataTokens = new RouteValueDictionary(new { area = "HelpPage" });
    }
}

我还应该提到,我没有任何其他路由在这个类,因为我使用属性路由对API方法单独。

相关文章

这篇文章主要讲解了“WPF如何实现带筛选功能的DataGrid”,文...
本篇内容介绍了“基于WPF如何实现3D画廊动画效果”的有关知识...
Some samples are below for ASP.Net web form controls:(fr...
问题描述: 对于未定义为 System.String 的列,唯一有效的值...
最近用到了CalendarExtender,结果不知道为什么发生了错位,...
ASP.NET 2.0 page lifecyle ASP.NET 2.0 event sequence cha...