Export (0) Print
Expand All

SiteMapProvider.GetParentNodeRelativeToNodeAndHintDownFromParent Method

Provides an optimized lookup method for site map providers when retrieving an ancestor node for the specified SiteMapNode object and fetching its child nodes.

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

abstract GetParentNodeRelativeToNodeAndHintDownFromParent : 
        node:SiteMapNode * 
        walkupLevels:int * 
        relativeDepthFromWalkup:int -> SiteMapNode  
override GetParentNodeRelativeToNodeAndHintDownFromParent : 
        node:SiteMapNode * 
        walkupLevels:int * 
        relativeDepthFromWalkup:int -> SiteMapNode

Parameters

node
Type: System.Web.SiteMapNode

The SiteMapNode that acts as a reference point for walkupLevels and relativeDepthFromWalkup.

walkupLevels
Type: System.Int32

The number of ancestor node levels to traverse when retrieving the requested ancestor node.

relativeDepthFromWalkup
Type: System.Int32

The number of descendant node levels to retrieve from the target ancestor node.

Return Value

Type: System.Web.SiteMapNode
A SiteMapNode that represents an ancestor of node; otherwise, a null reference (Nothing in Visual Basic), if the current or ancestor SiteMapNode is not found or cannot be returned for the current user.

ExceptionCondition
ArgumentOutOfRangeException

The value specified for walkupLevels or relativeDepthFromWalkup is less than 0.

ArgumentNullException

node is a null reference (Nothing in Visual Basic).

The default implementation of the SiteMapProvider class provides a non-optimized implementation of the GetParentNodeRelativeToNodeAndHintDownFromParent method, calling the HintAncestorNodes and HintNeighborhoodNodes methods; however, site map providers can override the GetParentNodeRelativeToNodeAndHintDownFromParent method and provide an optimized implementation that uses custom caching mechanisms to return the ancestor node and perform an optimized lookup of the other SiteMapNode objects. The GetParentNodeRelativeToNodeAndHintDownFromParent method is very similar to the GetParentNodeRelativeToCurrentNodeAndHintDownFromParent method.

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, a null reference (Nothing in Visual Basic) 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 SiteMapNode that is returned by the GetParentNodeRelativeToNodeAndHintDownFromParent method, using the ParentNode and ChildNodes properties. If there are fewer ancestor node levels than specified by the upLevel parameter, a null reference (Nothing in Visual Basic) is returned. It is up to the provider implementer to decide how to handle the situation where the number of available descendant node levels is less than the value that is specified by the downLevel parameter.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft