The SiteMapPath Control
The SiteMapPath
control displays a series of hyperlinks that lead back to the home page. It is sometimes known as a breadcrumb trail, as it resembles the trail of bread left behind by the fictitious characters Hansel and Gretel. It's the "You are here" sign that tells visitors to the site where they are. For example, when viewing a plant page, the SiteMapPath
control displays Home > Plant Catalog > Aloe Vera.
Having the SiteMapPath
control on the page makes it easy for visitors to get back to the plant catalog, or any other parent nodes. As we shall see, it is also fairly simple to include in an MCMS site.
In earlier versions of ASP.NET (version 1.x), we had to write recursive functions to get a collection of parent channels that lead up to the root. With the SiteMapProvider
that we've created earlier and the SiteMapPath
control, we can achieve the same result without writing a single line of code. Let's take a look at how it's done.
1. First, open the
TropicalGreen...