MVC设置启动页

        设置启动页需要在路由中添加一段代码:

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

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

posted @ 2017-03-27 12:15  EasyPass  阅读(3074)  评论(0编辑  收藏  举报