Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 24th, 2006, 12:40 PM
Registered User
 
Join Date: Aug 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default display hierarchical site map using repeaters

I want to display a three levels site map as three levels of tabs. I use three repeater controls and three SiteMapDataSource controls as follows:

<asp:Repeater ID="Repeater1" runat="server" DataSourceID="srcBuckets"> .....
<asp:Repeater ID="Repeater2" runat="server" DataSourceID="srcPails"> ......
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="srcContents"> .....

<asp:SiteMapDataSource ID="srcBuckets" runat="server" ShowStartingNode="False"/>
<asp:SiteMapDataSource ID="srcPails" runat="server" ShowStartingNode="False" StartingNodeOffset="1" />
<asp:SiteMapDataSource ID="srcContents" runat="server" ShowStartingNode="False" StartingNodeOffset="2" />

After running, it displays the 1st level of tabs correctly. But when I click on one tab, it displays the 2nd level of tabs twice(even the third repeater displays 2nd level tab). I don't understand why, because StartingNodeOffset="2" for 3rd repeater control.

Only after clicking on one tab of the 2nd level of tabs, the 3rd level of tabs is displayed correctly.

What's wrong with 3rd SiteMapDataSource settings?

Appreicate your help



 
Old August 31st, 2006, 11:18 AM
Friend of Wrox
 
Join Date: Feb 2006
Posts: 116
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Perhaps there is a solution for using three nested repeaters, but do you have to do it this way? The ASP.NET TreeView control might be a better fit for what you are after. You are after all, by default, connecting all three of your SiteMapDataSources to the same web.sitemap. You could cut this down to using one single treeview and one single siteMapDataSource, and achieve the same, plus a lot more functionality.

Neil Timmerman
Programmer
Veris Consulting





Similar Threads
Thread Thread Starter Forum Replies Last Post
Site Map mallikalapati ASP.NET 2.0 Basics 1 February 9th, 2008 02:56 PM
Passing more than one querystring in the site map kaushikpulpa ASP.NET 2.0 Basics 1 April 20th, 2007 08:08 AM
display hierarical site map using repeaters wlin ASP.NET 1.0 and 1.1 Basics 0 August 24th, 2006 12:35 PM
hierarchical display in datagrid aravwind General .NET 2 July 30th, 2004 03:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.