views:

44

answers:

2

Scenario: building a site where navigation will be in master page in either left or top menu. What are the advantages to using the ASP.NET navigation system based on web.sitemap files? The alternative I'm considering is just building the links in <li> elements as necessary.

+1  A: 

As Mitch said in the comment above, having a sitemap is a great way to encapsulate your page structure in an easy to update file. Aside from that, taking advantage of the SiteMapProvider allows you to use databinding to build numerous forms of navigational structures from a single sitemap file.

Aside from those advantages, the sitemap file is based on a standard that allows search engines to more easily index your site. This provides you a bit more SEO than would otherwise be had than without one.

Josh
Do you use them on your projects?
User
I am going to give a big ditto to what @kbrimington said. I have used sitemaps pretty extensively just for the flexibility it offers me when building multiple different forms of navigation. You can pretty much do anything you want with it.
Josh
+1  A: 

Web.Sitemap files are an effective, light-weight method to keep track of your links, and update them while your application is running without causing a restart. They provide built-in support for security trimming in authenticated scenarios.

They also ship with one giant shortcoming; that is, any single address can show up only once in the file, or there's trouble.

If none of the benefits listed are appealing in your particular situation, you may find that building your own static links is sufficient. You will find that in many other circumstances, the web.sitemap is a useful tool.

On an aside, I found the SqlSiteMapProvider to be a helpful tool, but it required us to create a client application for modifying the data.

kbrimington
Do you use them on your projects?
User
I have applications that use each of the methods we've discussed: direct page content, web.sitemap, and SqlSiteMapProvider. I used direct page content on very small applications, the sitemap on medium-sized applications over which I planned to administer, and the SqlSiteMapProvider in larger CMS-like systems where I wanted to provide users with the ability to update the navigation without touching the files in the web application.
kbrimington