Web Site Navigation Using a SiteMap
(Page 1 of 4 )
This article will explain how to implement site navigation using the ASP.NET 2.0 infrastructure consisting of SiteMap, SiteMapDataSource and navigational controls. These pieces can help you to quickly put up an aesthetically pleasing web site.
The SiteMap Class
For web site navigation, ASP.NET 2.0 offers an infrastructure that provides site map information for web page development using navigational controls and SiteMapDataSource controls. The SiteMap class depends therefore on SiteMapProvider and XmlSiteMapProvider (default) classes. The navigation support infrastructure may use all of the following items:
- Provider classes
- Web.sitemap file (XML)
- Navigational Controls
- SiteMapPath control
SiteMap is a container of site information (folders and files) represented in an XML format that provides the root node of the site, the SiteMapProvider used, and tracks the provider objects. System.Web.SiteMap inherits from System.Object. The default provider XMLSiteMapProvider works through the Web.sitemap. Besides being useful for site navigation, the sitemap also provides a easy way for search engines to look for pages on the site.
Create the folder structure for the site
Here is an example of a site with two folders, ColdFusion61 and MSAccess at the site http://localhost/Tutorials. This was the same site that was created in the tutorial for describing the concept of a Master page in VS2005. The unexpanded folder structure is shown in this picture.

The ColdFusionMX61 contains two web pages, Default.aspx and Coldfusion.aspx. The MSAccess folder contains three web pages, Ado.aspx, DAP.aspx, and Default.aspx. Besides these, each of the folders have their own images directory (now empty) to keep the images related to these folders. This detail is shown in the next picture.

Next: Adding a SiteMap to the site >>
More .NET Articles
More By Jayaram Krishnaswamy