System.Web.SiteMapProvider.GetParentNodeRelativeToCurrentNodeAndHintDownFromParent Method

Provides an optimized lookup method for site map providers when retrieving an ancestor node for the currently requested page and fetching the descendant nodes for the ancestor.

Syntax

public virtual SiteMapNode GetParentNodeRelativeToCurrentNodeAndHintDownFromParent (int walkupLevels, int relativeDepthFromWalkup)

Parameters

walkupLevels
The number of ancestor node levels to traverse when retrieving the requested ancestor node.
relativeDepthFromWalkup
The number of descendant node levels to retrieve from the target ancestor node.

Returns

A System.Web.SiteMapNode that represents an ancestor System.Web.SiteMapNode of the currently requested page; otherwise, null, if the current or ancestor System.Web.SiteMapNode is not found or cannot be returned for the current user.

Remarks

The default implementation of the System.Web.SiteMapProvider class provides a non-optimized implementation of the SiteMapProvider.GetParentNodeRelativeToCurrentNodeAndHintDownFromParent(int, int) method, calling the SiteMapProvider.GetCurrentNodeAndHintAncestorNodes(int) and SiteMapProvider.HintNeighborhoodNodes(SiteMapNode, int, int) methods; however, site map providers can override the SiteMapProvider.GetParentNodeRelativeToCurrentNodeAndHintDownFromParent(int, int) method and provide an optimized implementation that uses custom caching mechanisms to return the ancestor node and perform an optimized lookup of the other System.Web.SiteMapNode objects.

The walkupLevels parameter is used to specify how many levels of parent and ancestor nodes to traverse when retrieving the target node. If fewer levels exist than are requested, null is returned. The downLevel parameter is used to specify how many levels of descendant nodes from the target ancestor node to retrieve. If preferred, the ancestor and descendant nodes can be linked to the System.Web.SiteMapNode that is returned by the SiteMapProvider.GetParentNodeRelativeToCurrentNodeAndHintDownFromParent(int, int) method, using the SiteMapNode.ParentNode and SiteMapNode.ChildNodes properties.

Requirements

Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0