|
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Test page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
Hello <asp:LoginName ID="LoginName1" runat="server" />. If you want you may
<asp:LoginStatus ID="LoginStatus1" runat="server" /> now.
</LoggedInTemplate>
<AnonymousTemplate>
this should not be seen by anyone since only loged in users are allowed (see the
web config file)
</AnonymousTemplate>
</asp:LoginView>
<asp:LoginView ID="LoginView2" runat="server">
<RoleGroups>
<asp:RoleGroup Roles="Administrator">
<ContentTemplate>
<div style="clear:both;">The following button is only visible to admins
<asp:Button ID="cmdAdminButton" runat="server" Text="This is an admin button" OnClick="cmdAdminButton_Click" /></div>
</ContentTemplate>
</asp:RoleGroup>
<asp:RoleGroup Roles="User"><ContentTemplate>
<div style="clear:both;">The following button is only visible to users with role User
<asp:Button ID="cmdShowAMessage" runat="server" Text="Show me a message" OnClick="cmdShowAMessage_Click" /></div>
</ContentTemplate></asp:RoleGroup>
</RoleGroups>
</asp:LoginView>
<asp:Label ID="fldRoles" runat="server" Text=""></asp:Label>
</div>
</form>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.