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

I have two sitecollection A and B, i want to write a c# code on my webpart to read the topnavbar of sitecollection A at sitecollection B and display the same in ASPMenu control on site collection B.

So in nut shell my requirment is to display same menu accorss site collection in a webapplicaton and this should be dyanamically so when any new subsite added to any site collection all site collection will have the link at the same.

Thanks

share|improve this question

1 Answer 1

I wrote a post in my blog about this issue. Please, look here.

But in your case you should use

source.SiteMapProvider = "GlobalNavigation"; 

Also you should look at your web.cofig to set correct params of site map provider.

share|improve this answer
    
Thanks for your response, Just wanted to let you know my requirment in detail. I am having three sitecollection name A/B/C, all site collection having two subsite e.g. A1/A2 B1/B2 C1/C2 and finaly i want to display a menu like there will be there link A/B/C and when you do the click/mouse over on any item A/B/C sub menu will open for respective site collection. e.g. you have click on A sub menu will have two option A1 and A2 same for other B and C. Also when you go on any site collection or subsite all will have same pattern. –  Yogi Mar 26 '12 at 20:08
    
Continue to last comment;;; also when ever any new sub site added to any site collection show display new option in that menu. The approch i am using to raed all topnav bar and combine but doing some mistake. –  Yogi Mar 26 '12 at 20:08
    
this approach describes how to display menu from other site collection, thus you will have full copy of menu from site wich you would like to show. if you change menu items in source site, the changes are applyed in your target site. If your would like to show several menus, I suggest to add several controls for top menu rendering and use several data sources. You can place these controls one by one. –  Alexander Mar 26 '12 at 20:23

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.