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.

image

Listing 22.8. UsingMenu/MenuSiteMap.aspx

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

Get ASP.NET 4 Unleashed 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.