ASP.NET 2.0 Site Navigation Features
page 2 of 3
by Scott Guthrie
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 18628/ 38

Answers to a couple of common questions about Site Navigation

I’ve seen a few common questions about the Site Navigation feature from folks at conferences and in blogs that I thought would be worth quickly answering:

>>> Question: With the default XML File Provider can you use a filename other than web.sitemap to store your site map information?

Answer: Yes.  The filename used with the XML File Provider can be specified in your web.config file (the default name we configure is web.sitemap).  This MSDN article shows how to-do this (among other things).

>>> Question: With the default XML File Provider can you partition your site map definition across multiple files (for example: have a site map file stored in a sub-directory of the site that defines the sitemap makeup of just that sub-directory)?

Answer: Yes – that is pretty easy to-do.  This MSDN article shows how to-do this.

>>> Question: Is it possible to filter what nodes are visible in the site-map based on the security role permissions of the current user visiting the site (for example: hide those nodes that they don’t have access to)?

Answer: Yes. This MSDN article show how to-do this.

>>> Question: Is it possible to dynamically add nodes into a site-map (for example: for forum or blog post listings underneath a leaf node) without having to write a custom SiteMapProvider?

Answer: Yes.  This MSDN Article and this blog post discuss how to-do this.

>>> Question: Can you localize site-maps (for example: have German and English content).

Answer: Yes.  This MSDN article shows how to-do this.

>>> Question: Can you define a site map definition in something other than an XML file (for example: instead use a database?).

Answer: Yes.  The Site Navigation system is provider based, which means that you can use any custom provider implementation to define the site-map hierarchy.  What is even cooler, is that you can optionally use multiple providers together – for example: use the XML provider for the overall structure, but maybe a blog specific provider that goes against a blog database to populate the nodes dynamically underneath a portion of the site.

Jeff Prosise also has a cool sample that he talks about here on how to build a SiteMapProvider that retrieves the sitemap structure from a database rather than the default XML file provider.  This MSDN article also links to a bunch of content on building your own SiteMap provider.

The next version of SharePoint (which is heavily integrated on top of ASP.NET 2.0) will also include a SharePoint specific Site Navigation provider that dynamically populates the site-map with the content contained within a SharePoint site.

Hope this helps,


View Entire Article

User Comments

Title: sitemap   
Name: Vikash
Date: 2009-08-07 2:32:00 PM
i am also having same problem ,
Title: SiteMap Menu not working in Vista   
Name: Haresh
Date: 2009-08-01 3:03:59 PM
I created a web.sitemap and navigation controls (treeview & sitemap) on a master page in Vista. The Treeview works fine with the SiteMapDataSource, but the menu doesn't. I zipped up my files and ran the web site on an XP machine. The menu worked fine with the SiteMapDataSource without any changes.

Is there a bug in Vista that causes menu to not work with Sitemaps?
Title: Need help quick please   
Name: Tina
Date: 2007-06-18 1:32:30 AM
Regarding Question : >>> Question: With the default XML File Provider can you use a filename other than web.sitemap to store your site map information?

Can I have a XmlFileProvider which is named as a simple xml file like MySitemap.xml and not MySiteMap.sitemap. I need this as I need to produce the application and give it to the client and they will be updating the menu as need be ... And the requirement is that they get a file which a standard and normal xml file with .xml extention

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2022  |  Page Processed at 2022-09-27 2:45:19 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search