You can now use the Menu control in ASP.NET 2.0 to menu on the client side. No more client-side script!
Besides using the TreeView control to display site information, you can also use the Menu control to automatically generate a drop-down menu on the browser using client-side script. Sometimes menus are a useful means of navigating a site. For example, Nissan Motors USA (http://www.nissanusa.com) uses menus to allow visitors of their site to choose the various vehicle models they want to view.
In this lab, you will add a Menu control to the Master page created in the earlier lab Section 2.5. The user will then be able to use the Menu control to navigate your site.
Using the project created in the lab Section 2.5, add a Menu control (found in the Standard tab of the Toolbox) to the Master page and apply the "Colorful" theme (via the Auto Format... link in the MenuTasks menu) to change its look (see Figure 2-41).
Figure 2-41. Customizing the Menu control
In the Menu Tasks of the Menu control, select
SiteMapDataSource1 as its data source (see Figure 2-42). The SiteMapDataSource1 control was added
when the TreeView control was configured earlier.
Figure 2-42. Adding a Menu control to the Master page
To test the Menu control, ...