<a href="http://www.micropoll.com/akira/mpview/585320-168921">Click Here for Poll</a><a href="http://www.questionpro.com" title="online surveys">Online Survey</a><BR> | <a href="http://www.micropoll.com" title="Website Polls">Website Polls</a><BR> | <BR><a href="http://www.micropoll.com/akira/MicroPoll?mode=html&id=168921">View MicroPoll</A></div>

Visual Studio 2010!

Read now >

Windows Mobile Development Thoughts

Read now >

View Now
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.
ADVERTISEMENT
ADVERTISEMENT

 

DevSource.com: Your Source for Visual Studio on Facebook
ADVERTISEMENT
Making Like Magellan: Site Navigation Tools in ASP.Net 2.0
By Peter Aitken

Rate This Article: Add This Article To:

Making Like Magellan: Site Navigation Tools in ASP.Net 2.0 - ' Implementing the Map '
( 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!
 



 
 
>>> More ASP and .Net Coding Techniques Articles          >>> More By Peter Aitken