Skip to Content
ASP.NET 3.5 For Dummies®
book

ASP.NET 3.5 For Dummies®

by Ken Cox
February 2008
Intermediate to advanced
428 pages
8h 52m
English
For Dummies
Content preview from ASP.NET 3.5 For Dummies®

11.3. Adding a Breadcrumb Feature to Your Pages

A breadcrumb (implemented through the ASP.NET SiteMapPath control) displays the hierarchy as a single line of hyperlinks. Web designers usually place it near the top of the page. While the user navigates, ASP.NET tracks the current location according to the filename and matches the filename with what it finds in the Web.sitemap file. It can then look backward in the hierarchy to provide a trail to the starting point, including the levels in between.

If the breadcrumb doesn't show on a page, make sure that the page's filename (for example, lcl.aspx) is somewhere in the Web.sitemap file. If the filename's not there, it can't be tracked, and the SiteMapPath control won't have anything to display.

11.3.1. Creating a breadcrumb on a master page

This example puts the breadcrumb on a master page because it's far more convenient than repeatedly adding navigation controls to individual pages in a site. Follow these steps to add a breadcrumb to a master page:

  1. If you haven't already done so, add a Web.sitemap file to your project (FileNew FileSite Map) and add data from Listing 11-2.

  2. Add a master page to your project (FileNew FileMaster Page)

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

ASP.NET 3.5 Unleashed

ASP.NET 3.5 Unleashed

Stephen Walther
ASP.NET 4 Unleashed

ASP.NET 4 Unleashed

Stephen Walther, Kevin Hoffman, Nate Dudek

Publisher Resources

ISBN: 9780470195925Purchase book