Click here to Skip to main content
15,894,039 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I have created a menu in asp.net and managing the rights for each user through database entry.

I am able to successfully manage the main menu items and level 1 but the level 2 menu are not responding to the code. though in immediate window the the menu is searched, in running the 2nd level menu does not get removed. Following is the code:

VB
If dtMenuRights.Rows(0).Item("RORIPROJECTMACHINES.VIEW") = "False" Then
 If Menu1.FindItem("Project/Reports/Project Machines") IsNot Nothing Then
                        Menu1.FindItem("Project").ChildItems.Remove(Menu1.FindItem("Project/Reports/Project Machines"))
   End If
 End If


Thanks in advance
Posted

1 solution

Solved.

Replaced finditem("Projects") with finditem("Projects/Reports")

The reason: 'Project Machines' in a child item of reports and not projects.
 
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