How can I find SiteMapNode by its URL (or other key)?

I think C # ASP.NET SiteMap uses the URL as a dictionary key inside, as it constantly searches for URLs by URL and makes them unique. I want to use this lookup table, but I cannot find access to it.

What is the most efficient way to get a specific SiteMapNode from a url? Is there access to it?

My use case is that I want to create a navigation bar populated from a Sitemap, starting with a node that is deep from the root in my current parent node chain.

+6
performance c # sitemap
source share
1 answer

I found him. This is the SiteMapProvider class that provides the method, not the SiteMap or SiteMapNode where I looked. See http://msdn.microsoft.com/en-us/library/system.web.sitemapprovider.findsitemapnodefromkey.aspx .

I was able to use it like this:

var node = SiteMap.Provider.FindSiteMapNodeFromKey(key); 
+9
source share

All Articles