[.net]設定Area預設的Controller

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

var route = routes.MapRoute(
"Home_Default",
"",
new { controller = "Home", action = "index" }, 
new[] { "EventSorbet.Web.Areas.Consumer.Controllers" } 
);
route.DataTokens["area"] = "Consumer";
台北人,軟體工程師一枚,工作閒暇之餘記錄生活、分享整理資訊。
Posts created 105

發表迴響

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top