How to change login status in LoginView control

Saint picture Saint · Feb 18, 2011 · Viewed 22.1k times · Source

How to change status from first Template to second template when I'm login into the system?

<asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
    <AnonymousTemplate>
        [ <a href="~/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
    </AnonymousTemplate>
    <LoggedInTemplate>
        Welcome!
        [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="/Logout.aspx"/> ]
    </LoggedInTemplate>
</asp:LoginView>

How to detect login status?

Answer