Providing a view for a particular group : LoginView « Authentication Authorization « ASP.NET Tutorial






<%@ Page Language="C#" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Changing the View</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:LoginStatus ID="LoginStatus1" Runat="server" />
        
        <asp:LoginView ID="LoginView1" Runat="server">
            <LoggedInTemplate>
                REALLY important 
            </LoggedInTemplate>
            <AnonymousTemplate>
                basic information 
            </AnonymousTemplate>
            <RoleGroups>
                <asp:RoleGroup Roles="Admins">
                    <ContentTemplate>
                       You are an Admin!
                    </ContentTemplate>
                </asp:RoleGroup>
                <asp:RoleGroup Roles="CoolPeople">
                    <ContentTemplate>
                       You are cool!
                    </ContentTemplate>
                </asp:RoleGroup>
            </RoleGroups>
        </asp:LoginView>
    </form>
</body>
</html>








21.6.LoginView
21.6.1.The LoginView can display different content to different users depending on their authentication status.
21.6.2.Using Roles with the LoginView Control
21.6.3.LoginView control controls who views what on a particular part of a page
21.6.4.Providing a view for a particular group