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 am trying to Create Custom Navigation control which read Nodes from given PortalSiteMapDataSourceID and generate XML and then use XSLT to generate HTML out of it.How can i find selected node from DataSourceID so i can add one more XML selected = true ? Please advise

Thanks Ronak

share|improve this question

1 Answer 1

up vote 1 down vote accepted

This example is complicated, so I'm not sure that it is the best way in you case )

ProviderSettings settings = new ProviderSettings("GlobalNavSiteMapProvider", "Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c");
settings.Parameters["NavigationType"] = PortalNavigationType.Current.ToString();
settings.Parameters["EncodeOutput"] = "true";

PortalSiteMapProvider provider = (PortalSiteMapProvider)ProvidersHelper.InstantiateProvider(settings, typeof(PortalSiteMapProvider));
PortalSiteMapNode currentNode = (PortalSiteMapNode)provider.CurrentNode;
share|improve this answer
    
Thanks Alexander it helps to give me direction and achieve what i want. –  Ronak Mar 1 '12 at 14:26
    
I have a post that describes how to implement cross site collection navigation control. There are a litle explanation how to Portal site map provider works. I hope it will be helpful to undrestand what you wants to implement. –  Alexander Mar 1 '12 at 19:00

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.