【发布时间】:2013-10-12 12:45:14
【问题描述】:
我试图退出一个页面并让它重定向回主页,但它似乎无法离开该区域。
<div class="container">
<div class="pull-right">
<div class="span12">
@using (Html.BeginForm("LogOff", "Account", new { area = ""}, FormMethod.Post, new { id = "logoutForm" }))
{
@Html.AntiForgeryToken()
<text>
Hello, @Html.ActionLink(User.Identity.Name, "Manage", "Account", htmlAttributes: new { @class = "username", title = "Manage" })! | <a href="javascript:document.getElementById('logoutForm').submit()">Log off</a>
</text>
}
</div>
</div>
</div>
以上是_LoginPartial.cshtml。
当您登录时,它会将您发送到会员区,然后当您点击注销时,网址将更改为
/member/account/logoff 看起来它试图在成员区域中找到帐户控制器以调用注销的操作结果,但帐户控制器位于最初创建它的项目的根目录中。
【问题讨论】:
标签: c# html asp.net-mvc-4 area