Hi, all
I'm trying to provision a subsite using code. The site is created alright, but I want the Global Navigation to be "Display the same navigation as the parent site". It's not, it's using Structural Navigation.
The funny thing is that when I open the Navigation Settings in my browser, the correct option (same as parent) is selected! If I just click OK to save the settings, my site is updated and is now using the same navigation as the parent.
Does anyone have an idea why I need to enter Navigation Settings and click OK to make this work?
SPWeb web = (SPWeb)properties.Feature.Parent; WebNavigationSettings webSettings = new WebNavigationSettings(web); if (webSettings == null) { // Something weird happened. Just exit. return; } webSettings.GlobalNavigation.Source = StandardNavigationSource.InheritFromParentWeb; webSettings.Update();