Blogger :
XML Tips and Tricks
All posts :
All posts by XML Tips and Tricks
Category :
XML
Blogged date : 2005 May 23
Site maps are a visual way to show the layout of a Web site. Similar to an organization chart of an organization, it provides similar types of services for a Web application. It helps to break down the Web site content into increasingly specific subject areas that helps a visitor to understand the structure of a Web site.
Site maps are used to help improve search rankings and as a launching point into any point of a Web site. Traditionally, these were maintained as separate HTML documents. If a site changes regularly this external file often required additional maintenance and formatting. For example, as an external document any time a page was added, deleted, or changed, the external HTML file had to be edited or formatted. Within ASP 2.0 and Visual Studio 2005 a specific file called the web.sitemap was added. This XML based file is used to store the site map for a Web application. The following steps are an example of how to implement this feature within Visual Studio 2005.
Implementing a Site Map

1. Within an ASP.NET application add a Site map item to the project.

2. Once the item is added this expresses a set of XML elements called . Every page in the site can be entered into the map as a element and every element can contain other elements.

3. Build the relationship that expresses your site.

4. In order to use the site map information a new data control is available called the SiteMapDataSource. This control automatically reads the web.sitemap and exposes the data to other controls like a tree view. When both of these controls are added to a page the results are visible.