Binding to a Site Map

Like the SiteMapPath control, you can use the Menu control with a Site Map. Users can click menu items to navigate to particular pages in your website. Unlike the SiteMapPath control, however, the Menu control does not automatically bind to a Site Map. You must explicitly bind the Menu control to a SiteMapDataSource control to display nodes from a Site Map.

For example, the page in Listing 22.8 contains a menu that contains links to all the pages in a website (see Figure 22.8).

Figure 22.8. Displaying a Site Map with a Menu control.


Listing 22.8. UsingMenu/MenuSiteMap.aspx

When you initially open the page in Listing 22.8 ...

Get ASP.NET 4 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.