Dkong
Dkong

Reputation: 2788

How do I use FindSiteMapNodeFromKey(String)?

I'm looking to get a set of child nodes from a sitemap starting at a specific node. I've looked at the Microsoft documentation but don't really know how to use it.

Can anybody provide me an example?

Upvotes: 0

Views: 887

Answers (1)

NightOwl888
NightOwl888

Reputation: 56909

If you set the key on your mvcSiteMapNode, like this:

<mvcSiteMapNode title="My Action" action="MyAction" controller="MyController" key="1234" />

You can call FindSiteMapNodeFromKey() to get a reference to that node.

var node = MvcSiteMapProvider.SiteMaps.Current.FindSiteMapNodeFromKey("1234");

Upvotes: 2

Related Questions