Click here to Skip to main content
16,021,181 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
aspx:
XML
<div>
           <span class="preload1"></span><span class="preload2"></span>
           <ul id="nav2">
               <li class="top"><a href="Setup.aspx" class="top_link" title="Setup"><span class="down">
                   Setup</span></a>
                   <ul class="sub">
                       <li class="fly"><a href="#" class="fly">UserAuth<%--entication--%></a>
                           <ul>
                               <li><a href="UserAuthenticationAdd.aspx">Add</a></li>
                               <li><a href="#">Edit</a></li>
                               <li><a href="#">Delete</a></li>
                           </ul>
                       </li>
                   </ul>
               </li>
               <li class="top"><a href="#" id="products" class="top_link" title="Master"><span class="down">
                   Master</span></a>
                   <ul class="sub">
                       <li class="fly"><a href="#" class="fly" title="Class Master">Class</a>
                           <ul>
                               <li><a href="ClassAdd.aspx">Add</a></li>
                               <li><a href="ClassEdit.aspx">Edit</a></li>
                               <li><a href="ClassDelete.aspx">Delete</a></li>
                           </ul>
                       </li>
                       <li class="fly"><a href="#" class="fly" title="Subject Master">Subject</a>
                           <ul>
                               <li><a href="SubjectAdd.aspx">Add</a></li>
                               <li><a href="SubjectEdit.aspx">Edit</a></li>
                               <li><a href="SubjectDelete.aspx">Delete</a></li>
                           </ul>
                       </li>
                       <li class="fly"><a href="#" class="fly" title="Question Master">Question</a>
                           <ul>
                               <li><a href="QuestionAdd.aspx" title="Add">Add</a></li>
                               <li><a href="QuestionEdit.aspx">Edit</a></li>
                               <li><a href="QuestionDelete.aspx">Delete</a></li>
                           </ul>
                       </li>
                   </ul>
               </li>
              </ul>
        </div>


code vb:

VB
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Session("UserType") = "N" Then
            Transaction.Visible = False
            Master.Visible = False
            Report.Visible = False

        End If
        If Session("UserType") = "S" Then
            Transaction.Visible = False
        ElseIf Session("UserType") = "A" Then
            Report.Visible = True
            Transaction.Visible = True

        End If
    End Sub




This menu bar is in the master page.

I have a userAccess sqlserver table having a coloumn usertype(admin/supervisor/normal)

I want to control menu items according to usertype.

I have solved the top menu items, but i want to control the sub items(add/edit/delete)

Can anyone help me?
Posted
Updated 20-Jul-12 22:24pm
v3

1 solution

You need to write code, the obvious way is to emit your menu object with code that decides what to emit based on checking preferences, but something that allows you to put attributes on menu items and then works out what to show, would be nicer.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900