Wednesday, September 3, 2008

How to: Programmatically Modify Site-Map Nodes in Memory

Web sites frequently use dynamic URLs containing information that is appended as query strings. For example, the site for a newsgroup or forum might include static URLs that refer to forums or groups as well as dynamic URLs for each post. A URL for a post might be in the following format: http://www.microsoft.com/newsgroups/ShowPost.aspx?ForumID=2&PostID=53

Updating a site map to list the URL for every post is not an efficient approach because nodes cannot be added to a site map programmatically. However, when a user is viewing a post, you can use the SiteMapPath [ http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sitemappath(printer).aspx ] control to display the navigation path back to the root node and dynamically append query strings to each link in the path, identifying the post, forum, or group. For example, your navigation path to the preceding post might look like the following:

Home > Forum List > Post List

More...
http://msdn.microsoft.com/en-us/library/ms178425(printer).aspx

ASP.Net Feeds