Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menus And Roles Question

Status
Not open for further replies.

Gixonita

IS-IT--Management
Oct 17, 2005
103
0
0
US
Hello All,

I have a menu in which items within it should display depending on the role assigned. In the code below all roles should see the "Forms" option, and then, depending on the role, they should see "Admission", "Service", "Treatment", or "Discharge", only the Administrator should see ALL options. The problem I'm having is that when I log in as the Administrator to test it I see the "Forms" option, but in the sub menu (which should display the other 4 options) it only appears the very last one of them (Discharge). I tried commenting the options (one by one, or more that one at a time) and the problem is always the same, the sub menu only displays the last coded option. I'm kind of new at creating a menu that depends on the role so I'm not sure if I'm missing something or doing something wrong. Any help will be greatly appreciated.

Luis Torres

Code:
<asp:LoginView  ID="LoginView_FormsMenu"
                        runat="server" >
                        
            <RoleGroups>
            
                <asp:RoleGroup Roles="Administrator,Admission,Discharge,Service,Treatment">
                
                    <ContentTemplate>
            
                        <div class="Menu_Container">
                        
                            <ul>
                            
                                <li>
                                
                                    <a href="#nogo">Forms</a>
                                    
                                    <asp:LoginView  ID="LoginView_Admission"
                                                    runat="server">
                                                    
                                        <RoleGroups>
                                        
                                            <asp:RoleGroup Roles="Administrator,Admission">
                                            
                                                <ContentTemplate>
                                                
                                                    <div>
                                                    
                                                        <ul>
                                                        
                                                            <li>
                                                            
                                                                <a href="#nogo">Admission</a>   
                                                            
                                                            </li>
                                                        
                                                        </ul>
                                                    
                                                    </div>
                                                
                                                </ContentTemplate>
                                            
                                            </asp:RoleGroup>
                                        
                                        </RoleGroups>               
                                                    
                                    </asp:LoginView>
                                    
                                    <asp:LoginView  ID="LoginView_Treatment"
                                                    runat="server">
                                                    
                                        <RoleGroups>
                                        
                                            <asp:RoleGroup Roles="Administrator,Treatment">
                                            
                                                <ContentTemplate>
                                                
                                                    <div>
                                                    
                                                        <ul>
                                                        
                                                            <li>
                                                            
                                                                <a href="#nogo">Treatment</a>   
                                                            
                                                            </li>
                                                        
                                                        </ul>
                                                    
                                                    </div>
                                                
                                                </ContentTemplate>
                                            
                                            </asp:RoleGroup>
                                        
                                        </RoleGroups>               
                                                    
                                    </asp:LoginView> 
                                    
                                    <asp:LoginView  ID="LoginView_Service"
                                                    runat="server">
                                                    
                                        <RoleGroups>
                                        
                                            <asp:RoleGroup Roles="Administrator,Service">
                                            
                                                <ContentTemplate>
                                                
                                                    <div>
                                                    
                                                        <ul>
                                                        
                                                            <li>
                                                            
                                                                <a href="#nogo">Service</a>   
                                                            
                                                            </li>
                                                        
                                                        </ul>
                                                    
                                                    </div>
                                                
                                                </ContentTemplate>
                                            
                                            </asp:RoleGroup>
                                        
                                        </RoleGroups>               
                                                    
                                    </asp:LoginView>
                                    
                                    <asp:LoginView  ID="LoginView_Discharge"
                                                    runat="server">
                                                    
                                        <RoleGroups>
                                        
                                            <asp:RoleGroup Roles="Administrator,Discharge">
                                            
                                                <ContentTemplate>
                                                
                                                    <div>
                                                    
                                                        <ul>
                                                        
                                                            <li>
                                                            
                                                                <a href="#nogo">Discharge</a>   
                                                            
                                                            </li>
                                                        
                                                        </ul>
                                                    
                                                    </div>
                                                
                                                </ContentTemplate>
                                            
                                            </asp:RoleGroup>
                                        
                                        </RoleGroups>               
                                                    
                                    </asp:LoginView>
                                    
                                </li>
                            
                            </ul>
                        
                        </div>
                    
                    </ContentTemplate>
                
                </asp:RoleGroup>
            
            </RoleGroups>
        
        </asp:LoginView>
 
Hello All,

The roles were working perfectly, my CSS was the one on the fritz, had to move the <ul>s outside of the logingview declaration.

Thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top