Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top