2006-03-24
| Table of Contents: |
| Rate This Article: | Add This Article To: |
( Page 4 of 4 )
Implementing the Map: A Demonstration
Once you have created your Web.Sitemap file, what then? To implement navigation on your site, you have to use one or more of the controls listed above and connect them to the site map. Let's walk through using a Menu control for this purpose.
In this example, I placed the navigation elements on a master page, a technique that is very useful when you want the navigation elements to appear on many different pages on the web site. However, the techniques are essentially the same, even if you are not using a master page.
Assuming that you have already created the Web.Sitemap file as described above, you start by placing a SiteMapDataSource control on the page. This is an invisible control, and it automatically binds to the data in the Web.Sitemap file in the web site's root. To bind to a file with a different name or location, you have to edit the configuration in the project's Web.Config file.
Next, place a TreeView control on the page and set its DataSourceID property to the ID of the SiteMapDataSource control. That's it, you're done. The results are shown in Figure 1.
Discuss Making Like Magellan: Site Navigation Tools in ASP.Net 2.0 >>> Be the FIRST to comment on this article!
![]() |
|


