System.Web.StaticSiteMapProvider.AddNode Method

Adds a System.Web.SiteMapNode to the collections that are maintained by the site map provider and establishes a parent/child relationship between the System.Web.SiteMapNode objects.

Syntax

protected override void AddNode (SiteMapNode node, SiteMapNode parentNode)

Parameters

node
The System.Web.SiteMapNode to add to the site map provider.
parentNode
The System.Web.SiteMapNode under which to add node.

Remarks

The site map node that is identified by the node parameter is added to an internal collection and a parent-child relationship is created between it and the site map node that is identified by the parentNode parameter.

The URL for a site map node might be interpreted when it is added to the internal collections. Application-relative and relative URLs are expanded to application-absolute virtual paths, which are then used internally to store and access the individual instances of the System.Web.SiteMapNode class. Other URLs, such as physical paths, paths with protocols in them, and UNC paths, are not interpreted.

The System.Web.XmlSiteMapProvider class, which is derived from the System.Web.StaticSiteMapProvider class, and is the default site map provider for ASP.NET, uses the SiteMapNode.Url property of a System.Web.SiteMapNode object as a lookup key in its internal collections, by default. If the SiteMapNode.Url property of the System.Web.SiteMapNode is set, it must be unique within the scope of the site map provider. The StaticSiteMapProvider.FindSiteMapNode(string) method attempts to retrieve site map nodes based on their SiteMapNode.Url property. Otherwise, you can use the SiteMapNode.Key property and the corresponding StaticSiteMapProvider.FindSiteMapNodeFromKey(string) method to retrieve site map nodes. If no SiteMapNode.Url or SiteMapNode.Key is specified, the site map provider automatically generates a SiteMapNode.Key to track the site map nodes.

Requirements

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