ASP.NET v2 LoginView

R

RedEye

Hello,

I have been looking for a way to add roles to a LoginView control
programmatically and it's not working. I have called the sub at init and
load and neither work. Does anyone know what I may be over looking?

Thanks for any help

Private Sub AddRoles()
Dim rg As New RoleGroup
rg.Roles = New String() {"Members, Managers"}
LoginView1.RoleGroups.Add(rg)
End Sub

<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>You are not logged in.</AnonymousTemplate>
<RoleGroups>
<asp:RoleGroup>
<ContentTemplate>
You see this if you are a member or manager
</ContentTemplate>
</asp:RoleGroup>
</RoleGroups>
<LoggedInTemplate>
Greetings and welcome back
</LoggedInTemplate>
</asp:LoginView>

RedEye
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top