Export (0) Print
Expand All

XmlSiteMapProvider.AddNode Method (SiteMapNode, SiteMapNode)

Adds a SiteMapNode object to the collections that are maintained by the current provider.

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

abstract AddNode : 
        node:SiteMapNode * 
        parentNode:SiteMapNode -> unit  
override AddNode : 
        node:SiteMapNode * 
        parentNode:SiteMapNode -> unit

Parameters

node
Type: System.Web.SiteMapNode

The SiteMapNode to add to the provider.

parentNode
Type: System.Web.SiteMapNode

The SiteMapNode under which to add node.

ExceptionCondition
ArgumentNullException

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

ArgumentException

The current XmlSiteMapProvider is not the provider associated with node.

InvalidOperationException

A node with the same URL or key is already registered with the XmlSiteMapProvider. - or -

A duplicate site map node has been encountered programmatically, such as when linking two site map providers.

- or -

node is the root node of the XmlSiteMapProvider.

The node parameter is added to an internal collection, and a parent/child relationship is created between it and parentNode.

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

.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