LoginStatus control in asp.net

2019-09-20 04:54发布

Any one help me out, how to work with LoginStatus control in asp.net...

the statu before login should be 'userlogin' after logged in ,it automatically changes to 'userlogout'

any suggestions??

1条回答
再贱就再见
2楼-- · 2019-09-20 05:48

How about this

<asp:LoginView ID="ctlRightNavbar" runat="server">
   <AnonymousTemplate>
       <a href="/login.aspx" class="navbar">userlogin</a>
   </AnonymousTemplate>
   <LoggedInTemplate>
      <a href="/logout.aspx" class="navbar">userlogout</a>
   </LoggedInTemplate>
</asp:LoginView>

This will make a more custom view for you if you do not wish to use LoginStatus. You can read more about the above code sample here.

查看更多
登录 后发表回答