473,493 Members | 4,355 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Adding Menus Dynamically in asp.net

14 New Member
Hi..

I am using an menu control for which i am adding menuitems programmatically as follows:-
Expand|Select|Wrap|Line Numbers
  1. MenuItem mi = new MenuItem(TextBox1.Text);
  2. Menu1.Items.Add(mi);
  3.  
  4. MenuItem mi1 = new MenuItem(TextBox2.Text);
  5. mi.ChildItems.AddAt(0, mi1);
  6.  
  7. MenuItem mi2 = new MenuItem(TextBox3.Text);
  8. mi1.ChildItems.AddAt(0, mi2);
Expand|Select|Wrap|Line Numbers
  1. Menu1
  2.    Menu2
  3.       Menu3
but if i have to adding another menu for Menu2 or for Menu1 is not possible..



Can anyone please guide me??
Jan 17 '12 #1
0 1347

Sign in to post your reply or Sign up for a free account.

Similar topics

6
2159
by: Nick | last post by:
Id like to create some list menus dynamically. The problem is that id like the option text to be different from the option values. For example... <script language=JavaScript> city = 'Los...
20
12863
by: David | last post by:
I have a one-line script to add an onunload event handler to the body of the document. The script is as follows: document.getElementsByTagName("BODY").onunload=function s() {alert("s")} Now...
3
1683
by: Punisher | last post by:
I'm adding checkbox controls to a table dynamically when the form loads for the first time. When a postback occurs, the controls are not maintained in the table. How do I get them to retain...
0
996
by: lucky | last post by:
hi there!!! as the title tells. my problem is that, i'm trying to add row which contains a user control, into the table dynamically. but every time i tried to add row, it adds only one row into...
1
2459
by: Sheryl Landon | last post by:
Is there a way to set the OnCommand or OnClick attributes when adding a LinkButton dynamically through code? These attributes are available when adding on design-time... Thanks, Sheryl
2
1627
by: grawsha2000 | last post by:
Hello, How can I add a table to asp.net page dynamically with Code Behind style. I still can't find a way of doing it. This really causes me a big problem when I deal with records from...
6
1510
by: crazyjh | last post by:
hello i want to add some controls in according of the time. but when the time change, i call the method again to add controls again,No effect! i think maybe i should unload the controls adding...
2
1191
by: laxmibokka | last post by:
adding controls dynamically In my asp.net application, i have to add dropdownlist(with yes/no options), and textbox to the table cells dynamically to each row of a table.The table also contains some...
1
1679
by: Paddy | last post by:
The problem I am facing is as follows: I am populating an HTML table on my webpage with rows of data from a database. The rows may be sometimes 10 and sometimes say,3. I have two buttons on that...
7
6176
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I'm adding subheadings to a gridview. Each sub head has a few link buttons. I'm adding the controls in the rowdatabound event code follows: sorry about the length here. I have to be missing...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.