Export (0) Print
Expand All

SiteMapProvider.HintAncestorNodes Method

Provides a method that site map providers can override to perform an optimized retrieval of one or more levels of parent and ancestor nodes, relative to the specified SiteMapNode object.

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

public virtual void HintAncestorNodes(
	SiteMapNode node,
	int upLevel
)

Parameters

node
Type: System.Web.SiteMapNode

The SiteMapNode that acts as a reference point for upLevel.

upLevel
Type: System.Int32

The number of ancestor SiteMapNode generations to fetch. 0 indicates no ancestor nodes are retrieved and -1 indicates that all ancestors might be retrieved and cached.

ExceptionCondition
ArgumentOutOfRangeException

upLevel is less than -1.

ArgumentNullException

node is null.

The default HintAncestorNodes method only checks for an upLevel parameter that is less than -1 and a node parameter that is null. Because the XmlSiteMapProvider class caches site map information in memory, the HintAncestorNodes method is not used.

Site map providers can override the HintAncestorNodes method to perform an optimized retrieval of parent and ancestor nodes of the specified SiteMapNode object.

The upLevel parameter is used to specify how many levels of parent and ancestor nodes to traverse from the specified SiteMapNode. If fewer levels exist than are requested, all available ancestor nodes are returned within the specified bound. If preferred, the parent node can be linked to the specified SiteMapNode using the ParentNode property.

.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