Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic menu in asp.net 2.0 using database

Status
Not open for further replies.
Apr 11, 2002
193
IN
Hi,

I want to create a dynamic menu control in ASP.net 2.0 which would be based on database values.
For instance
There are 3 database tables named:
Catagories Products Sub-Products
---------- -------- ------------
id ProdId ProdId
Name CategoryID SubProdName
ProdName

Values would be

Categories
-----------
ID Name
1 Beverages
2 Dairy Products

Products
----------
ProdId CategoryId ProdName
1 1 soft drinks
2 1 tea
3 2 Milk

Sub-Products
------------
ProdId SubProdName
1 Coke
1 Pepsi
2 Ice tea
3 Butter
3 Cheese

I want the menus like

Categories
Beverages->soft drink->Coke
Pepsi
tea->Ice tea
Dairy Products->Milk->Butter
->Cheese

Can someone give me an idea about how to do this in ASP.net 2.0 using the menu control.

Thanks,
Manish
 
Hi,

Thanks for the reply. That link doesnt provide a dynamic menu as fieldnames are hardcoded in it. I have found some code which is much more generic. Here it is


But this gives me just one Root node. I want multiple Root nodes horizontally like our browser menus(File, Edit, View...).

Can anyone know how to make this happen?

Thanks,
Manish
 
If you look again... a little bit down on the page it shows how to populate the menu from the database. That is why I posted the article.. take some time and look at it.. and search the internet... you will find what you are looking for..
 
Hi,

You are right it does contain how to populate the menu from the database..but it works perfect in case you want to create a vertical menu. I want to create a horizontal menu where there are multiple root nodes which can have multiple child nodes. I did search the internet for 2 days and couldn't find any solution for it.

I hope i find something soon.

Thanks,
Manish
 
Also, I notice that although you have been a member for over 4 years and asked a few questions on the forums here, you haven't marked any of the answers as valuable, and I can only see one or two acknowledgments of other peoples responses. If you are not getting the answers that you need read FAQ222-2244 to see how to ask better questions. If you are getting the answers you need see FAQ222-2244 to see how to acknowledge the answers given.

Paragraph 16 of the FAQ explains about this being a two-way forum, to give guidance on answering other peoples questions, as I also notice that you haven't yet made any posts in other peoples threads.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top