1
我使用的主要_Layout.cshtml我Index.cshtml这是在“区域 - >查看 - >主页”。 由于此链接登录&登录名生成错误(这是在主_LogOnPartial.cshtml内)。
即,它作为产生的 “http://本地主机/管理员/用户/注销”,但它应为被生成的 “http://本地主机/用户/注销”
_LogOnPartial.cshtml代码
<div class="btn-group pull-right">
@if (Request.IsAuthenticated)
{
<text>
@* Welcome <strong>@User.Identity.Name</strong>!*@
@Html.ActionLink("Log Off", "LogOff", "User", null, new { @class = "btn btn-action btn-first" }) </text>
}
else
{
<text>@Html.ActionLink("Log In", "Login", "User", null, new { @class = "btn btn-action btn-last" }) @Html.ActionLink("Register", "Register", "User", null, new { @class = "btn btn-action" })</text>
}
</div>
你如何生成你的链接? –
这是我们在_LogOnPartial.cshtml中使用的相同逻辑 –