انا استخدم الـ VS 2005 Web Developer
واستخدم الـ LoginView Control عشان استفيد من الـ RoleGroup Elements
The problem is that I need to create a sub procedure BUT I can not get the LoginView child controls properties ..
I'll give u a very simple thing just to get the idea
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub LoginView1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
'Here I need a code to change Label1 text
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:LoginView ID="LoginView1" runat="server" OnLoad="LoginView1_Load">
<AnonymousTemplate>
<asp:Login ID="Login1" runat="server" DestinationPageUrl="Default3.aspx">
</asp:Login>
</AnonymousTemplate>
<RoleGroups>
<asp:RoleGroup Roles="admin">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="This is the Admin Page"></asp:Label>
</ContentTemplate>
</asp:RoleGroup>
</RoleGroups>
</asp:LoginView>
</div>
</form>
</body>
</html>
<%@ Page Language="VB" %>