在開發過程中,我們有時候需要啟動區域中的頁面為起始頁面,那我們就需要子啊路由中添加一段代碼
如何完整案例:
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");
}