Uredi

Deli z drugimi prek


XmlSiteMapProvider.FindSiteMapNode(String) Method

Definition

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

Parameters

rawUrl
String

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

Returns

A SiteMapNode that represents the page identified by rawURL.

Exceptions

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

Remarks

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.

Applies to

See also