StaticSiteMapProvider.FindSiteMapNode(String) Method
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 that represents the page at the specified URL.
public:
override System::Web::SiteMapNode ^ FindSiteMapNode(System::String ^ rawUrl);
public override System.Web.SiteMapNode FindSiteMapNode (string rawUrl);
override this.FindSiteMapNode : string -> System.Web.SiteMapNode
Public Overrides Function FindSiteMapNode (rawUrl As String) As SiteMapNode
- rawUrl
- String
A URL that identifies the page for which to retrieve a SiteMapNode.
A SiteMapNode that represents the page identified by rawURL
; otherwise, null
, if no corresponding site map node is found.
rawURL
is null
.
The provided URL is typically a virtual or absolute URL. It can also be a URL that uses ASP.NET application-relative syntax, such as "~/apprelativedirectory"
. The StaticSiteMapProvider class automatically normalizes application-relative raw URLs to an absolute virtual path.
The XmlSiteMapProvider object, which is derived from the StaticSiteMapProvider and is 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 site map provider. The FindSiteMapNode method attempts to retrieve site map nodes based on their Url. Otherwise, you can use the Key property and the corresponding FindSiteMapNodeFromKey method to retrieve site map nodes. If no Url or Key is specified, the site map provider automatically generates a Key property to track the site map nodes.
When overriding the FindSiteMapNode(String) method in a derived class, be sure to normalize the URLs of the SiteMapNode objects that you add to your site map provider, so that the FindSiteMapNode(String) method can retrieve a site map node regardless of whether URL for the site map node is supplied as an absolute virtual path or an application relative path.
Security trimming behavior is included in the SiteMapProvider and StaticSiteMapProvider class implementations. However, for security trimming to function in derived classes, you must set the Roles property of any SiteMapNode objects that you create while building a site map provider when you override the BuildSiteMap() method.
Produto | Versões |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Comentários do .NET
O .NET é um projeto código aberto. Selecione um link para fornecer comentários: