Dooie
Dooie

Reputation: 1669

Dynamic Navigation

I am building a project in asp.net 4.0. My navigation will be database driven where i return a datatable from the db containing all the pages of my site, some will be top level while others will be children and sometimes children of children n-times.

Im thinking of going down the nested repeater route and databinding from code behind, dynamically generating repeaters for children, but have read that this is not a best practice and should consider the listview control.

Im wanting to build a list of links using an unordered list.

I cannot find a solid example and was hoping for some pointers/ideas.

Thanks

Doo

Upvotes: 0

Views: 522

Answers (1)

Peter
Peter

Reputation: 9712

My suggestion would be to use the sitemap provider and make a custom one. I did this at work for the framework we built and it sounds pretty similar to what you are trying to do. It might require a little effort up front but the nice thing is that once your done the rest of the built in navigation features just work.

Here is a link to an article from MSDN magazine on how to build your own SQL Site Map Provider.

http://msdn.microsoft.com/en-us/magazine/cc163657.aspx

Upvotes: 1

Related Questions