Amendment for the ASP.NET Page (removing the unnecessary ondatabinding and ontransforming events)
Main Topics
Browse All TopicsHi Experts
I am creating a website of portals in which I have many companies and these companies are having multiple brands and even in these brands there are multiple categories, as shown below:
1. Citizen.
Men
a. Quartz
b. ...
Women
a. ....
b. .....
Wrist Watch
2. Tissot.
Wrist Watches
Wall Clocks
3. Omega
.....
this is just an example, but there are no fix no. of brands or products. they want to add / modify products or categories any time...
I have created a table in this way:
CategId Level Category URL ParentId
1 0 MainCompany 0
2 1 Citizen 1
3 1 Tissot 1
4 1 Omega 1
5 2 Men 2
6 2 Women 2
7 3 Quartz 5
I have table but I don't know how can I retrieve all the tree (items) and add them in ASP.NET menu control.
or is there any other way to do this easily
Thanks in Advance....
Imtiaz
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thanks a lot for your kind help it is working fine,
but I need to know is it supporting even further categories inside, lets suppose in WOMEN category there are further categories on the basis of colours, then will this support this ????
if it supports multiple categories then I exactly need this ...
Thanks again for your useful help, and I saw that you have created a website and database at your side, thanks for your useful time...
actually I am working in VB.NET but I can convert your C# code into VB.NET,...
My apologies. I should have realised that the For Xml Explicit is just that, explicit and the depth must be explicitly coded. In such case, the best way is to return the xml data as is and let a xslt document perform the n-level deep transformation.
Since the approach is different, I have made a second proposed solution for your perusal.
This is a fantastic solution great explanation and it works!!! One question I have is in regard to limiting access to menu items. The SiteMap provider allows you to limit access based on users roles. Can you describe how that might be accomlished with this approach. Happy to open another question and grant points - just let me know.
Business Accounts
Answer for Membership
by: b1xml2Posted on 2008-08-20 at 07:54:39ID: 22270233
Your current table structure does not allow mobility since it hard codes the level, the following is an example of a mobile menu data table.
The appendix document contains snapshots of the SQL Table Structure, Foreign Key Constraint as well as the desired Xml from the table.
The data structure is like so;
CategoryId, CategoryName, CategoryUrl, ParentId
Select allOpen in new window
recovered: Appendix.doc