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中使用的相同邏輯 –