MVC设置启动页

时间:2023-12-27 23:22:13

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

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");
        }