View Single Post
  #1 (permalink)  
Old January 11th, 2010, 12:04 PM
kwilliams kwilliams is offline
Banned
Points: 1,561, Level: 16
Points: 1,561, Level: 16 Points: 1,561, Level: 16 Points: 1,561, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2005
Location: , , .
Posts: 317
Thanks: 0
Thanked 0 Times in 0 Posts
Question asp:RoleGroup: Only pulls first rolegroup in list

I have a very simple page that displays a link for each rolegroup that a member belongs to with ASP.NET membership, lets say Group1 and Group2. For some reason, I can only see the first of two links in a list, regardless of which group it is.

I've already verified that both groups are pulling in fine by moving the Group2 link above Group1 to see if it could be viewed: which it was!

If Group1 is listed above Group 2, I see the link to Group1. But if I move the link for Group2 above Group1, I see the Group 2 link. I don't have a bunch of snazzy-dazzy complicated code on this page, so I'm stumped. Why could this be happening? I'd appreciate any help. Here is my code:

groups.aspx.vb
Code:
Partial Class groups
    Inherits System.Web.UI.Page

    'Pull username
    Dim strLoginUserID As String = Context.User.Identity.Name
End Class
groups.aspx
Code:
<%@ Page Language="VB" title="List of Groups" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" EnableSessionState="true" EnableViewState="false" CodeFile="groups.aspx.vb" Inherits="groups" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:LoginView ID="LoginView1" runat="server">
        <RoleGroups>
            <asp:RoleGroup Roles="Group1">
                <ContentTemplate>
                    You are a member of group 1: <asp:HyperLink ID="hlGroup1" NavigateUrl="group1.aspx" runat="server">Group1</asp:HyperLink>
                </ContentTemplate>
            </asp:RoleGroup>
            <asp:RoleGroup Roles="Group2">
                <ContentTemplate>
                    You are a member of group 2: <asp:HyperLink ID="hlGroup2" NavigateUrl="group2.aspx" runat="server">Group2</asp:HyperLink>
                </ContentTemplate>
            </asp:RoleGroup>
        </RoleGroups>
    </asp:LoginView>
</asp:Content>