I'm trying to update top navigation node URL while I'm creating site programmatically from custom template using below code, but for some reason querystring removed by sharepoint , however, SharePoint Server Publishing Infrastructure feature is enabled in site collection as well in custom site template SharePoint Server Publishing feature in enabled
SPWeb web = site.AllWebs[SiteName];
web.AllowUnsafeUpdates = true;
foreach (SPNavigationNode TopNode in web.Navigation.TopNavigationBar)
{
TopNode.Properties["UrlQueryString"] = "p=" + ProjectNo;
TopNode.Update();
}
web.AllowUnsafeUpdates = false;
thanks