SiteMapProvider.FindSiteMapNodeFromKey(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves a SiteMapNode object based on a specified key.
public:
virtual System::Web::SiteMapNode ^ FindSiteMapNodeFromKey(System::String ^ key);
public virtual System.Web.SiteMapNode FindSiteMapNodeFromKey (string key);
abstract member FindSiteMapNodeFromKey : string -> System.Web.SiteMapNode
override this.FindSiteMapNodeFromKey : string -> System.Web.SiteMapNode
Public Overridable Function FindSiteMapNodeFromKey (key As String) As SiteMapNode
Parameters
- key
- String
A lookup key with which a SiteMapNode is created.
Returns
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
.
Remarks
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.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기