asp.net mvc 设置启动页面在区域中

 在开发过程中,我们有时候需要启动区域中的页面为起始页面,那我们就需要子啊路由中添加一段代码

 如何完整案例:

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

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

posted @ 2016-07-02 16:12  骚年丶勿忘初心。  阅读(3065)  评论(0编辑  收藏  举报