| Main ASP .NET Tutorial Index |
Scott Mitchell June 2006 Download the ASPNET_Data_Tutorial_3_CS.exe sample code. Contents of Tutorial 3 (Visual C#)
Introduction Step 4: Adding Breadcrumb NavigationTo complete the master page, let's add a breadcrumb navigation UI element to each page. The breadcrumb quickly shows users their current position within the site hierarchy. Adding a breadcrumb in ASP.NET 2.0 is easy – just add a SiteMapPath control to the page; no code is needed. For our site, add this control to the header
<span class="breadcrumb">
<asp:SiteMapPath ID="SiteMapPath1" runat="server">
</asp:SiteMapPath>
</span>
The breadcrumb shows the current page the user is visiting in the site map hierarchy as well as that site map node's "ancestors," all the way up to the root (Home, in our site map).
Figure 12. The Breadcrumb Displays the Current Page and its Ancestors in the Site Map Hierarchy
|
||||

