This documentation is archived and is not being maintained.

XmlSiteMapProvider.FindSiteMapNodeFromKey Method

Note: This method is new in the .NET Framework version 2.0.

Retrieves a SiteMapNode object based on a specified key.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public override SiteMapNode FindSiteMapNodeFromKey (
	string key
)
public SiteMapNode FindSiteMapNodeFromKey (
	String key
)
public override function FindSiteMapNodeFromKey (
	key : String
) : SiteMapNode

Parameters

key

A lookup key with which to search for a SiteMapNode.

Return Value

A SiteMapNode that represents the page identified by key; otherwise, a null reference (Nothing in Visual Basic), 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.

Exception typeCondition

ProviderException

A child provider linked to the current site map provider returned a node that is not valid.

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

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

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Show: