Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
ASP.NET
 <asp:Menu ID="Menu1" runat="server"  Orientation="Horizontal" StaticSubMenuIndent="10px"
<asp:MenuItem Text="DashBoard"></asp:MenuItem>
<asp:MenuItem Text="Project">
<asp:MenuItem Text="Config Project"></asp:MenuItem>
<asp:MenuItem Text="Task"></asp:MenuItem>
</asp:MenuItem>

<asp:MenuItem Text="Employees">
                      <asp:MenuItem  Text="EMS"></asp:MenuItem>
                       <asp:MenuItem Text="TimeSheet">
     <asp:MenuItem Text="Period"></asp:MenuItem>
<asp:MenuItem Text="Report"></asp:MenuItem>
</asp:MenuItem>
</asp:MenuItem>
 </asp:Menu>




I am new in C#..how can i hide Task,Report menu items from menu list on page load ,considering this menu in master page.I tried searching for similar question but didn't get right solution!
Posted
Updated 30-Apr-13 12:06pm
v2
Comments
Sergey Alexandrovich Kryukov 30-Apr-13 17:44pm    
Ever tried to find anything by yourself?
—SA
Michael Hank 30-Apr-13 18:00pm    
@SA i m' Scratching stackoverflow and other sites for past 1 hr and even go through your provided link still cundnt find Solution.

1 solution

 
Share this answer
 
Comments
Michael Hank 30-Apr-13 17:57pm    
@SA through your provided link m able to remove/hide first menu items i.e Dashboard,Employee,Project but not there sub items
Yvar Birx 30-Apr-13 18:10pm    
Why don't you go ahead and loop through the items of the items you are looping through too? I mean, from this point of view, hiding a master item would make you unable to look at the subitems, right? Good work once again SA.
Sergey Alexandrovich Kryukov 30-Apr-13 18:29pm    
Yes, recursively.
—SA
Michael Hank 30-Apr-13 18:46pm    
how do i loop menuitem containing menuitems.....as menuitem dont have id like menu.
yes hiding master item will hide all sub items but what about hiding only selected subitems say Period,Report in my case
Sergey Alexandrovich Kryukov 30-Apr-13 18:29pm    
You do it in a similar way. Each sub-item has access through its parent item...
—SA

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