起始路由改成分区(Areas)的RouteConfig.cs配置方法

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 }
        defaults: new { controller = "Default", action = "Index", id = UrlParameter.Optional },
        namespaces: new string[] { "ZJ.MVC5.Platform.Areas.Movie" }
        ).DataTokens.Add("Area", "Movie");

}

 

posted @ 2019-08-23 14:41  轴轴  阅读(545)  评论(0编辑  收藏  举报