Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In my SharePoint 2010 solution I am creating Top Link Navigation programmatically ( on feature activation). Now on other feature activation I am adding a subsite to my site. I want my sub site to inherit the parent site's TLN. But I didn't find any parameter for this in the following method e.g. parent.Webs.Add(siteURL, siteTitle, "", Convert.ToUInt32(LOCALE_ID_ENGLISH), siteTemplate, false, false);

How can I inherit Top Link Navigation in my sub site?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You can inherit the navigation via:

SPWeb web = parent.Web.Add(/*params....*/);
web.Navigation.UseShared = true;

Use it just after you have created the site.

More Information: MSDN

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.