区域的路线值 (MVC3)
我正在使用 MVC 版本 3 中的区域。 我的注销和登录操作方法正在路由到该区域,我需要它们路由到不在该区域中的普通控制器。
我尝试了以下
主机://AREA/CONTROLLER/METHOD 而不是主机://CONTROLLER/METHOD。
@if(Request.IsAuthenticated) {
<text>Welcome <b>@Context.User.Identity.Name</b>
[ @Html.ActionLink("Log Off", "LogOff", "Account", new { area = "" }) ]</text>
}
else {
@:[ @Html.ActionLink("Log On", "LogOn", "Account", new { area = "" }) ]
}
I am using areas in MVC version 3.
My logoff and logon action methods are routing to the area, and I need them to route to the normal controller that is not in an area.
I have tried the following
host://AREA/CONTROLLER/METHOD instead of host://CONTROLLER/METHOD.
@if(Request.IsAuthenticated) {
<text>Welcome <b>@Context.User.Identity.Name</b>
[ @Html.ActionLink("Log Off", "LogOff", "Account", new { area = "" }) ]</text>
}
else {
@:[ @Html.ActionLink("Log On", "LogOn", "Account", new { area = "" }) ]
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经弄清楚了。
显然我需要额外的参数,它被应用于错误的重载。
I have figured this out.
Apparently I need the additional parameter, it's being applied to the wrong overload.