Skip to Content
Beginning ASP.NET 3.5: In C# and VB
book

Beginning ASP.NET 3.5: In C# and VB

by Imar Spaanjaars
March 2008
Intermediate to advanced content levelIntermediate to advanced
766 pages
21h 15m
English
Wrox
Content preview from Beginning ASP.NET 3.5: In C# and VB

7.2. Using the Navigation Controls

ASP.NET 3.5 offers three useful navigation tools: SiteMapPath, Menu, and TreeView. Figure 7-3 shows basic examples of the three navigation controls, without any styling applied.

The SiteMapPath on the left shows the user the path to the current page. This helps if users want to go up one or more levels in the site hierarchy. It also helps them to understand where they are. The TreeView can display the structure of your site and allows you to expand and collapse the different nodes; in Figure 7-3 the entire tree is expanded. When the page first loads, the Menu on the right only displays Home. However, as soon as you move the mouse over it, a submenu will appear showing the child nodes of the Home page element. In Figure 7-3 one of these child elements is the Reviews item, which in turn has child elements itself.

Figure 7-3. Figure 7-3

7.2.1. Architecture of the Navigation Controls

To make it easy to show relevant pages in your site using a Menu, a TreeView, or a SiteMapPath, ASP.NET uses an XML-based file that describes the logical structure of your web site. By default, this file is called Web.sitemap. This file is then used by the navigation controls in your site to present relevant links in an organized way. Simply by hooking up one of the navigation controls to the Web.sitemap file you can create complex user interface elements like fold-out ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning ASP.NET 4: in C# and VB

Beginning ASP.NET 4: in C# and VB

Imar Spaanjaars
Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Bill Evjen, Scott Hanselman, Devin Rader

Publisher Resources

ISBN: 9780470187593Purchase book