Dynamically Generate A Navigation Menu

Posted by Sharpcnet under C# on 1/28/2014 | Points: 10 | Views : 489 | Status : [Member] | Replies : 1
The navigation menu would look like

Home    Folio                Contact
People -Men Email
-Women Phone -Num1
Places -Num2

All these items come from Database - tblForm
Id  FormName  Url        Status   FormRef
1 Home home.aspx 0
2 Folio # 0
3 Contact # 0
4 People # 0 2
5 Men men.aspx 1 4
6 Women women.aspx 1 4
7 Places places.aspx 1 2
8 Email email.aspx 1 3
9 Phone # 0 3
10 Num1 num1.aspx 1 9
11 Num2 num2.aspx 1 9
I see various articles suggesting stringbuilder, repeater and htmlGeneric controls. None of them have examples for such a menu with 3 level dropdowns.
Totally no clue which one to use and how to loop to acheive this.
Any guidance is appreciated.
The Database table structure can be changed if needed.




Responses

Posted by: Ajayk3 on: 3/18/2014 [Member] Starter | Points: 25

Up
0
Down
MenuItem Menu = new MenuItem();
Menu.Text = "People";
NavigationMenu.Items[1].ChildItems.Add(Menu);

Sharpcnet, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response