如何将第一个模板的状态更改为第二模板,当我登录系统时?

<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>
.

如何检测登录状态?

有帮助吗?

其他提示

The LoginView Control handles this for you. It is done using the ASP.NET Forms authentication and the "IsAuthenticated" property that is managed by ASP.NET.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top