I have Custom Master page with added Custom Control for navigation display. The PortalSiteMapDataSource on master page looks like this:

<PublishingNavigation:PortalSiteMapDataSource ShowStartingNode="false" SiteMapProvider="GlobalNavigationSwitchableProvider" ID="topSiteMap" runat="server" StartingNodeUrl="sid:1002" />

Now I want to use this Source in my menu:

PortalSiteMapDataSource ds = (PortalSiteMapDataSource)this.Parent.FindControl(DataSourceId);
System.Web.SiteMapProvider smp = ds.Provider;
var root = smp.RootNode;
var nodes = smp.GetChildNodes(root);

My problem is that nodes always contains the navigation from the root web of Site Collection even with InheritNavigation is set to false on SubWeb.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.