天天看點

asp.net mvc設定area頁面為預設路由

1.在routeconfig裡添加如下代碼:

routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces:new string[]{"EFTest.Controllers"}
            ).DataTokens.Add("Area","Test");
           

area結構如下:

asp.net mvc設定area頁面為預設路由

繼續閱讀