ASP.NET v2 LoginView

Discussion in 'ASP .Net' started by RedEye, Jul 8, 2005.

  1. RedEye

    RedEye Guest

    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
    RedEye, Jul 8, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sunfire
    Replies:
    0
    Views:
    346
    sunfire
    Jun 14, 2007
  2. eschneider

    LoginView & ASP.NET Membership help

    eschneider, Aug 25, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    569
    eschneider
    Aug 25, 2009
  3. RedEye

    ASP.NET v2 LoginView Help

    RedEye, Jul 15, 2005, in forum: ASP .Net Security
    Replies:
    0
    Views:
    140
    RedEye
    Jul 15, 2005
  4. Jack
    Replies:
    1
    Views:
    880
    Alessandro Zifiglio
    Jul 3, 2006
  5. LLars
    Replies:
    2
    Views:
    274
    LLars
    Feb 14, 2006
Loading...

Share This Page