bhagyap 0 Light Poster

Hi..

I am using an menu control for which i am adding menuitems programmatically as follows:-


MenuItem mi = new MenuItem(TextBox1.Text);
Menu1.Items.Add(mi);
MenuItem mi1 = new MenuItem(TextBox2.Text);
mi.ChildItems.AddAt(0, mi1);
MenuItem mi2 = new MenuItem(TextBox3.Text);
mi1.ChildItems.AddAt(0, mi2);
Menu1
SubMenu1
SubMenu2
Menu2
SubMenu1

and so on..

but if i have to add another menu for Menu2 or for Menu1 is not possible and am not able to retain the state of menucontrol; i mean wenever i debug it next time i am not able to view previously added menus..

Can anyone please guide me??

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.