Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

SiteMapProvider.FindSiteMapNodeFromKey Method

Retrieves a SiteMapNode object based on a specified key.

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)
public virtual SiteMapNode FindSiteMapNodeFromKey(
	string key
)

Parameters

key
Type: System.String

A lookup key with which a SiteMapNode is created.

Return Value

Type: System.Web.SiteMapNode
A SiteMapNode that represents the page identified by key; otherwise, null, if no corresponding SiteMapNode is found or if security trimming is enabled and the SiteMapNode cannot be returned for the current user. The default is null.

The SiteMapProvider implementation returns null in all cases. Classes that derive from the SiteMapProvider class can override the FindSiteMapNodeFromKey method to provide lookup functionality based on a unique key (instead of a URL, which is used by the FindSiteMapNode method). Implement the FindSiteMapNodeFromKey method if your site map provider implementation uses the SiteMapNode.Key property of a SiteMapNode object as a primary identifier in a site map structure.

The StaticSiteMapProvider class provides an implementation that handles searching for site map nodes that do not define a URL.

The XmlSiteMapProvider class, which is the default site map provider for ASP.NET, uses the URL of a SiteMapNode as a key in the various collections that the classes maintain. Therefore, if a node provides a URL, it must be unique within the scope of the site map provider. If no URL is provided, a unique identifier is generated to identify the SiteMapNode.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft. All rights reserved.