Introduction

For use in Microsoft Content Management Server, this Site Map web control displays channel structure in a hierarchical tree that is expandable and collapsible when viewed in a IE4+ or NS6+ browsers. When viewed in NS4, the tree is fully expanded. The starting channel is configurable so you can have multiple instances of the control in one page, rendering different portions of a site if so desired.

Note the media="all" attribute in the stylesheet reference. It prevents NS4 from reading it, as SiteMap.css is not compatible with NS4. If you don't care for NS4, you can also copy the content of SiteMap.css and add it into your site stylesheet.

Please check if there are any conflicts between your site stylesheet and SiteMap.css. For example, the sample site WoodgroveNetVB messes up the rendering quite badly.

Copy channel.gif, channelopen.gif, and channelclosed.gif into the image directory as specified in the property ImagePath.

Copy SiteMap.js into the directory as specified in the property JavascriptPath.

Rebuild the solution in VS.NET.

History

V1.0 - 2004.02.15 - Base.

V1.1 - 2005.02.12 - Added an option to limit the channel depth.

V1.2 - 2006.05.15 - Added an option to show the postings in the tree. Added an ASP.NET 2.0 version.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

In a large site, where the tree is deep, this code will not perform very well. The page hosting the site map will take a long time to load.
It would have been better to get the first two levels of the tree, and then respond to expand requests by posting back to the server.
And of course you always need to use asp.net caching, at the page or control level.

You can't cache ASP.NET controls or they don't do validation or proper postback b/c they lose session info (for CMS this isn't healthy). You can cache web user controls (.ascx files) - but any ASP.NET controls they contain may get screwy.