我想设置区域Stage里的Controller的Index为起始页,RouteConfig做了这样的修改
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new string[] { "Products.Areas.Stage.Controllers" }
).DataTokens.Add("Areas", "Stage");
为什么跳转的还是原来的起始页呢?
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new string[] { "Products.Areas.Stage.Controllers" }
).DataTokens.Add("area", "Stage");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new string[] { "Products.Areas.Stage.Controllers" }
).DataTokens.Add("area", "Stage");