asp.netnavigationsitemapweb.sitemap

ASP.NET: What are the advantages of using sitemap-based navgiation?


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.


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.