无法在asp.net核心中调用注销方法

时间:2017-04-25 14:23:17

标签: asp.net asp.net-mvc asp.net-core-identity

我使用此代码从dropdownmenu注销但无法正常工作

<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>

这是我的表格

<form asp-area="" asp-controller="Account" asp-action="Logout" method="post" id="logoutForm" class="navbar-right">
    <ul class="nav navbar-nav navbar-right">

        <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">@UserManager.GetUserName(User)! <span class="caret"></span></a>
            <ul class="dropdown-menu">
                <li><a href="#">Gigs I'm Going</a></li>
                <li><a href="#">Artist I'm Following</a></li>
                <li role="separator" class="divider"></li>
                <li>
                    <a href="javscript:document.getElementById('logoutForm').submit()">Log out</a>
                </li>
            </ul>
        </li>
    </ul>
</form>

0 个答案:

没有答案