Share via


SPXmlContentMapProvider.FindSiteMapNode Method (String)

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

Namespace:  Microsoft.SharePoint.Navigation
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Public Overrides Function FindSiteMapNode ( _
    rawUrl As String _
) As SiteMapNode
'Usage
Dim instance As SPXmlContentMapProvider
Dim rawUrl As String
Dim returnValue As SiteMapNode

returnValue = instance.FindSiteMapNode(rawUrl)
public override SiteMapNode FindSiteMapNode(
    string rawUrl
)

Parameters

Return Value

Type: System.Web.SiteMapNode
A SiteMapNode that represents the page identified by rawURL. If no corresponding SiteMapNode is found, or if security trimming is enabled and the node cannot be returned for the current user, then the method returns a a null reference (Nothing in Visual Basic) reference. (Nothing in Visual Basic).

Exceptions

Exception Condition
ArgumentNullException

A required String value is a null reference (Nothing in Visual Basic).

InvalidOperationException

Error occurred while retrieving the SiteMapNode object.

Remarks

The URL provided can be a virtual or absolute URL. It might also be a URL that uses application-relative syntax, such as ~/apprelativedirectory. Implementations that use this method should ensure that application-relative syntax is properly parsed.

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

Notes to Inheritors

When overriding the SiteMapNode method in a derived class, the implementer should also search any child providers, if a SiteMapNode object that matches the URL is not found by the provider in the current site map and the provider supports child providers.

See Also

Reference

SPXmlContentMapProvider Class

SPXmlContentMapProvider Members

FindSiteMapNode Overload

Microsoft.SharePoint.Navigation Namespace

FindSiteMapNodeFromKey

StaticSiteMapProvider