ASP.NET 2.0, Breadcrumb (SiteMapPath) and TreeView on same page

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

I can envision a situation where I want part of our site to be navigated
using a TreeView, and ALL of our site to have a Breadcrumb (SiteMapPath
control). Is there a way to maintain a single SiteMaptDataSource
(Web.sitemap) for both, but only have 1/2 of the nodes visible in the
TreeControl, and have ALL the nodes visible in the Breadcrumb?

We could maintain two Web.sitemaps, but that sounds like a annoying
maintenance issue.

Thanks in advance.

Mark
 
Hi Mark:

You can take advantage of a SiteMapDataSource control. The TreeView
can bind to the data source control, and the data source control has
properties that allow you to filter and trim the nodes that will be
seen. The bread crumb, on the other hand, goes directly to the site
map provider for unfiltered information. Definitely no need to write
two sitemaps.
 
When you add the SiteMapPath to a page, a SiteMapDataSource control is added
to the page, as well. You can add as many of these as you need to filter
controls differently off a single web.sitemap.


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top