Subject: display hierarchical site map using repeaters
Posted By: wlin Post Date: 8/24/2006 12:40:49 PM
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



Reply By: thenoseknows Reply Date: 8/31/2006 11:18:54 AM
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

Go to topic 45413

Return to index page 188
Return to index page 187
Return to index page 186
Return to index page 185
Return to index page 184
Return to index page 183
Return to index page 182
Return to index page 181
Return to index page 180
Return to index page 179