C# MVC 设置起始页

来源:互联网 发布:淘宝店主电话采集器 编辑:程序博客网 时间:2024/05/16 09:22

Area分区

public static void RegisterRoutes(RouteCollection routes)        {            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");            routes.MapRoute(                name: "Default",                url: "{controller}/{action}/{id}",                defaults: new { controller = "SiteInfo", action = "Index", id = UrlParameter.Optional },                namespaces: new string[] { "Iweb.Areas.SiteInfo.Controllers" }            ).DataTokens.Add("Area","SiteInfo");        }



无Area,不分区

  public static void RegisterRoutes(RouteCollection routes)        {            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");            routes.MapRoute(                name: "Default",                url: "{controller}/{action}/{id}",                defaults: new { controller = "SiteInfo", action = "Index", id = UrlParameter.Optional }            );        }


0 0
原创粉丝点击