Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hallo,

I want to build a structure of a navigation menu like this dynamically:

Item 1
Item 1.1
Item 1.2
Item 2
Item 3
Item 3.1
...

I am using code behind to create the items and add them to the list:

VB
Dim mi1 As New MenuItem("Item1")
        NavigationMenu.Items.Add(mi1)



How can I create child items to build a structure?

Thanks
Posted
Comments
shek124 14-Nov-11 6:05am    
Provide the code completely

1 solution

Hope following links help you

SQL
Add MenuItems Dynamically in ASP.Net



http://forums.asp.net/t/1056954.aspx/1

or you can add items based on some condition like
C#
foreach (MenuItem item in Menu1.Items) 
{      
if (condition) 
{        
item.Items.Add("Your Item Name")}  
 // ...    
} 
 
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