Retrieves the parent site map node of a specific System.Web.SiteMapNode object.
- node
- The System.Web.SiteMapNode for which to retrieve the parent site map node.
A System.Web.SiteMapNode that represents the parent of the specified System.Web.SiteMapNode; otherwise, null, if no parent site map node exists or the user is not permitted to see the parent site map node.
The System.Web.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 System.Web.StaticSiteMapProvider class, and use System.Web.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 SiteMapNode.ParentNode property is not found, the System.Web.StaticSiteMapProvider class detects whether the current site map provider has a SiteMapProvider.ParentProvider property. If so, the site map provider calls the StaticSiteMapProvider.GetParentNode(SiteMapNode) 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 StaticSiteMapProvider.GetParentNode(SiteMapNode) method calls the StaticSiteMapProvider.BuildSiteMap method internally to retrieve the System.Web.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.