开发者

StartingNodeUrl - How to programmatically get its value?

开发者 https://www.devze.com 2022-12-13 00:22 出处:网络
Is it possible to get the value for StartingNodeUrl programmatically? My sitem开发者_Go百科ap has 3 levels to it at it\'s deepest and, depending on what section your are in I want to display all of t

Is it possible to get the value for StartingNodeUrl programmatically?

My sitem开发者_Go百科ap 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消