views:

88

answers:

1

Is it possible to get the value for StartingNodeUrl programmatically?

My sitemap has 3 levels to it at it's deepest and, depending on what section your are in I want to display all of the children below the parent in a navigation.

I reckon all I have to do is look at where I am in the navigation and put a value in StartingNodeUrl. But I cannot!

Code snippet from MasterPage:

<asp:Repeater ID="Repeater1" DataSourceID="SiteMapDataSource1" runat="server">
    <ItemTemplate>
        menu items here
    </ItemTemplate>
</asp:Repeater>
<asp:SiteMapDataSource ID="SiteMapDataSource1" ShowStartingNode="false" StartingNodeUrl="/about/" runat="server" />

Thanks in advance.

JRenney

A: 

To get the StartingNodeUrl programmatically:

string startNodeUrl = SiteMapDataSource1.StartingNodeUrl;

It sounds like you're looking to operate from the current node though, so I imagine that the SiteMapDataSource.StartFromCurrentNode property is more useful for you.

jball