10.3. Implementing Navigation in ASP.NET Web Sites

While ASP.NET 2.0 provides a number of controls to implement site navigation, almost all of them depend on a sitemap. A sitemap is simply an XML file (called web.sitemap) that stores the navigational information about the site in a structured format. The ASP.NET navigation controls use this XML file as a source of data to display the information contained in different graphical manners.

10.3.1. Creating sitemaps

SharePoint Designer provides a template file that allows you to start building a web.sitemap file for your Web site. To create a web.sitemap file, choose File New to display the New dialog box. In the ASP.NET section of the Page tab is the Site Map option. The default sitemap file that SharePoint Designer creates has the following code:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
   <siteMapNode url="" title=""  description="">
         <siteMapNode url="" title=""  description="" />
         <siteMapNode url="" title=""  description="" />
   </siteMapNode>
</siteMap>

The sitemap XML file needs the <siteMap> element as the root element for the XML structure. Within the <siteMap> element, there needs to be at least one <siteMapNode> element that describes the name, relative URL, and description of the link in the site navigation. Then, you have a </siteMapNode> that helps define ...

Get Microsoft® Office SharePoint® Designer 2007 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.