O'Reilly logo

ASP.NET 2.0: A Developer's Notebook by Wei-Meng Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Create a Site Map for Your Web Site

Note

Your users will never be lost again if you create a site map for your web site!

Unless your web site contains only a single web page, you need a way for users to easily navigate between the pages of your site. In ASP.NET 2.0, there are four new controls that make it easy to implement site navigation. These controls are:

SiteMapDataSource

A control that represents a site map. A site map is an XML file that describes the logical structure of a web site and the relationship between its pages. The SiteMapDataSource control is not visible on the page when it is loaded, but its role is to act as a supplier of site information (taken from the site map file) to the SiteMapPath control.

SiteMapPath

A visual control that depicts the path to the current page, "bread crumb" style.

Menu

A visual control that displays information in menu form. The Menu control supports data binding to a site map.

TreeView

A visual control that displays information in a hierarchical structure. The TreeView control supports data binding to a site map.

In the remaining labs in this chapter, you will learn how to use these controls to make it easy for users to navigate your web site. But first, let's take a closer look at the SiteMapDataSource and SiteMapPath controls.

How do I do that?

In this lab, you'll see how you can use the SiteMapPath control together with the Web.sitemap file to display navigation paths on your site pages. First, you'll create a web application that uses ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required