about LoginView control usage when a user in more than one user group

Discussion in 'ASP .Net' started by Sinan Alkan, Oct 3, 2008.

  1. Sinan Alkan

    Sinan Alkan Guest

    Hi All.

    I have three user role groups
    Admin
    B2B
    B2C

    Some users are in more than one group. Assume that user XXX is in both Admin
    and B2B role groups.

    My problem is, in a LoginView control, if i use <asp:RoleGroup> for all user
    group one by one, like that...

    <RoleGroups>
    <asp:RoleGroup Roles="Admin">
    <ContentTemplate>
    <asp:Button ID="Button1" runat="server" Text="aaaa" />
    </ContentTemplate>
    </asp:RoleGroup>
    <asp:RoleGroup Roles="B2B">
    <ContentTemplate>
    <asp:Button ID="Button2" runat="server" Text="bbbb" />
    </ContentTemplate>
    </asp:RoleGroup>
    <asp:RoleGroup Roles="B2C">
    <ContentTemplate>
    <asp:Button ID="Button3" runat="server" Text="cccc" />
    </ContentTemplate>
    </asp:RoleGroup>

    the loginview control shows only the first button (Button1) for user XXX but
    that user also in B2B group.
    If i set roles like

    <asp:RoleGroup Roles="Admin,B2B">
    <ContentTemplate>
    <asp:Button ID="Button1" runat="server" Text="aaaa" />
    <asp:Button ID="Button2" runat="server" Text="bbbb" />
    </ContentTemplate>
    </asp:RoleGroup>
    <asp:RoleGroup Roles="B2C">
    <ContentTemplate>
    <asp:Button ID="Button3" runat="server" Text="cccc" />
    </ContentTemplate>
    </asp:RoleGroup>

    this time, the other B2B users which are not in Admin group simultaneously
    can see the Button1 not just Button2

    How can i set the <RoleGroups> section to show the both controls Button1 and
    Button2 to users which are in Admin and B2B
    And just Button2 for the only users which are only in B2B group, so on ...
    Button3 for B2C group....


    Thanks in advance..

    ALKAN
     
    Sinan Alkan, Oct 3, 2008
    #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. Alan Silver
    Replies:
    4
    Views:
    520
    Alan Silver
    Jul 3, 2005
  2. Merciadri Luca
    Replies:
    4
    Views:
    821
  3. Bob Rashkin
    Replies:
    5
    Views:
    74
    Dennis Lee Bieber
    Dec 23, 2013
  4. Steven D'Aprano
    Replies:
    0
    Views:
    99
    Steven D'Aprano
    Dec 23, 2013
  5. Replies:
    3
    Views:
    89
    Gary Herron
    Dec 23, 2013
Loading...

Share This Page