0
我有地區,並在該地區我有Home/Index
,其中包含Authorize
屬性。
什麼是使這個動作默認爲我的應用程序的正確方法。
因此,當用戶類型:
mysite.com
在areaRegistration.cs打開Home/Index
代碼默認操作,如果用戶通過身份驗證 - asp mvc
context.MapRoute(
"CityPage_default",
"CityPage/{controller}/{action}/{id}",
new { controller="Home", action = "Index", id = UrlParameter.Optional }
);
此路由設置應該在global.asax中嗎? – 1110 2012-02-11 14:18:06
@ 1110,在你的'〜/ Areas/AreaName/AreaNameAreaRegistration.cs'中。 – 2012-02-11 14:20:12
我在我的areaRegistration.cs中添加了代碼,但這不起作用 – 1110 2012-02-11 14:22:32