Export (0) Print
Expand All

XmlSiteMapProvider.FindSiteMapNode Method (String)

Retrieves a SiteMapNode object that represents the page at the specified URL.

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

public override SiteMapNode FindSiteMapNode(
	string rawUrl
)

Parameters

rawUrl
Type: System.String

A URL that identifies the page for which to retrieve a SiteMapNode.

Return Value

Type: System.Web.SiteMapNode
A SiteMapNode that represents the page identified by rawURL.

ExceptionCondition
ProviderException

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

The XmlSiteMapProvider object overrides the FindSiteMapNode method to ensure that any linked child providers are searched for the node if the implementation of the base class does not return a node for the specified URL.

The rawUrl parameter should be either an absolute virtual path or an application-relative path, depending on how it is specified in the XML site map data file.

The XmlSiteMapProvider class and classes that are derived from it use the URL of a SiteMapNode object as a key in the various collections that the class maintains. Therefore, these URLs must be unique within the scope of the site map. If the URL is not found within the immediate site map data that is managed by the XmlSiteMapProvider, it calls the FindSiteMapNode on each child provider that is linked to it through the provider attribute of its site map nodes.

The FindSiteMapNode method indirectly calls the BuildSiteMap method to retrieve the top-level node in the site map. Therefore, any exceptions that occur for the BuildSiteMap method can also occur when calling the FindSiteMapNode method.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft