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