AspDotNetAtoms.com provides daily updates on ASP.NET Tutorials, Programming Resources, .NET Articles, Authors and more.

Categories

Recent Posts

Three Cures for Common Site Map Ailments : Jeff Prosise

Thursday, July 03 2008

Data-driven site navigation is among the niftiest and most useful features in ASP.NET 2.0. To get it working, all you do is create an XML site map file (or a SQL site map if you're using the MSDN®Magazine SqlSiteMapProvider), add a SiteMapDataSource, and bind a TreeView or Menu to the SiteMapDataSource. Just like that, you have a data-driven navigation UI. If the structure of your site changes, simply update the site map and the navigation UI changes to match. For good measure, you can throw in a SiteMapPath control to implement a bread crumb element showing the path to the current page. In many cases, building a navigation UI really is that easy. But it's also easy to run into snags using the ASP.NET 2.0 data-driven site navigation infrastructure and find yourself up against a wall searching for a way out. One of the most common ailments is TreeView branches that don't stay expanded or collapsed as you click around a site. Another is unmapped pages—pages that don't appear in the site map and therefore don't display in SiteMapPath controls (even though you want them to). A third involves pages that contain multiple navigation controls: a TreeView on the left and a Menu at the top, for example. It's easy enough to bind both controls to a SiteMapDataSource. But once you do, how do you configure them to show one set of links in the TreeView and another set in the Menu...

Read More:
Three Cures for Common Site Map Ailments : Jeff Prosise
Also See:
Make ASP.NET Speak Typed Text : Richard Bean
A Guide to the ASP.NET 2.0 Wizard Control : Steve C. Orr
Working with WebParts Page, WebPart Zones & WebParts : Muhammad Mosa
Web Parts in ASP.NET : Richard Bean
The Weekly Source Code 30 - VB.NET with XML Literals as a View Engine for ASP.NET MVC : Scott Hanselman's Computer Zen - ASP.NET

Post your comment

Comment