Export (0) Print
Expand All

StaticSiteMapProvider.GetParentNode Method

Retrieves the parent site map node of a specific SiteMapNode object.

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

'Declaration
Public Overrides Function GetParentNode ( _
	node As SiteMapNode _
) As SiteMapNode

Parameters

node
Type: System.Web.SiteMapNode

The SiteMapNode for which to retrieve the parent site map node.

Return Value

Type: System.Web.SiteMapNode
A SiteMapNode that represents the parent of the specified SiteMapNode; otherwise, Nothing, if no parent site map node exists or the user is not permitted to see the parent site map node.

ExceptionCondition
ArgumentNullException

node is Nothing.

The SiteMapNode objects delegate to the site map provider to keep track of their child and parent site map nodes. As a result, classes that implement a site map provider for a hierarchical site map structure, such as the StaticSiteMapProvider class, and use SiteMapNode objects to represent site map nodes, must track the hierarchical relationships of all site map nodes in order to be able to navigate an entire hierarchical tree.

If a ParentNode property is not found, the StaticSiteMapProvider class detects whether the current site map provider has a ParentProvider property. If so, the site map provider calls the GetParentNode property for the parent site map provider. This enables the scenario where the parent site map node of a site map node is maintained by a different site map provider.

The GetParentNode method calls the BuildSiteMap method internally to retrieve the SiteMapNode that represents the parent of the specified site map node. If security trimming is enabled, the site map node is returned only if the user is permitted to see it.

.NET Framework

Supported in: 4.6, 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