MVC 4 post 自动重定向到我不想要的操作

MVC 4 post automatically redirect to action that i dont want

我在使用 ASP.NET MVC 4 应用程序时遇到问题。 我有一个带有休闲代码的部分视图:

<li>@using (Html.BeginForm("LogOff", "Account", FormMethod.Post,
    new { id = "logoutForm", style = "display: inline;" }))
{
    @Html.AntiForgeryToken()
    <a href="javascript:document.getElementById('logoutForm').submit()">Log out</a>
}
</li>

在我点击 "Log out" 之后,我被重定向到:/Account/Login?ReturnUrl=%f2Account%f2LogOff 并开始操作:

//
// GET: /Account/Login

[AllowAnonymous]
public ActionResult Login()
{
    ViewBag.Title = loginTitle;
    return View();
}

但我想实际处理这个问题:

[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult LogOff()
{
    Session["user"] = null;
    return RedirectToAction("Index", "Index");
}

你能帮帮我吗?

您在注销期间似乎没有登录。