如何在asp.net中将引导登录更改为注销
本文关键字:登录 注销 asp net | 更新日期: 2023-09-27 18:19:08
我使用Bootstrap与ASP.net母版页,所以导航栏是在母版页我如何更改登录图标注销用户登录后,反之亦然。请提供一些例子
您可以添加类或图像链接:
@if (Request.IsAuthenticated)
{
// ...here you have a link to logut - you can add class or image or whatever you need
<a href="javascript:document.getElementById('logoutForm').submit()">Log off</a>
// ...
}
else
{
// ... here you have a link to log-in - you can add class or image or whatever you need
<li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
// ...
}