System.Web.XmlSiteMapProvider.FindSiteMapNodeFromKey Method

Retrieves a System.Web.SiteMapNode object based on a specified key.

Syntax

public override SiteMapNode FindSiteMapNodeFromKey (string key)

Parameters

key
A lookup key with which to search for a System.Web.SiteMapNode.

Returns

A System.Web.SiteMapNode that represents the page identified by key; otherwise, null, if security trimming is enabled and the node cannot be shown to the current user or the node is not found by key in the node collection.

Remarks

The System.Web.XmlSiteMapProvider class overrides the StaticSiteMapProvider.FindSiteMapNodeFromKey(string) method to ensure that any linked child providers are searched for the node, if the implementation for the base class does not return a node for key.

The System.Web.XmlSiteMapProvider object, derived from the System.Web.StaticSiteMapProvider class and the default site map provider for ASP.NET, uses the SiteMapNode.Url property of a System.Web.SiteMapNode object as a lookup key in its internal collections, by default. If the SiteMapNode.Url property of the System.Web.SiteMapNode is set, it must be unique within the scope of the provider. If no SiteMapNode.Url is specified, the System.Web.XmlSiteMapProvider automatically generates a SiteMapNode.Key to track the nodes.

The XmlSiteMapProvider.FindSiteMapNodeFromKey(string) method might call the XmlSiteMapProvider.BuildSiteMap method on any child providers that are associated with the current provider. Therefore, the exceptions that are described in the XmlSiteMapProvider.BuildSiteMap method might be thrown.

Requirements

Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0