This documentation is archived and is not being maintained.

SiteMapNodeCollection::Add Method

Adds a single SiteMapNode object to the collection.

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

public:
virtual int Add(
	SiteMapNode^ value
)

Parameters

value
Type: System.Web::SiteMapNode
The SiteMapNode to add to the SiteMapNodeCollection.

Return Value

Type: System::Int32
The index of the InnerList where the SiteMapNode was inserted.

ExceptionCondition
ArgumentNullException

value is nullptr.

NotSupportedException

The SiteMapNodeCollection is read-only.

You cannot add a SiteMapNode object to a read-only or fixed-size SiteMapNodeCollection collection. You can test whether a SiteMapNodeCollection is read-only by checking the IsReadOnly property.

This section contains two code examples. The first code example demonstrates how to create a new SiteMapNodeCollection collection and add elements to it. The second code example demonstrates how to add elements to a custom site map provider.

The following code example demonstrates how to use the SiteMapNodeCollection constructor to create a new SiteMapNodeCollection, and then add elements to it with the Add method.

No code example is currently available or this language may not be supported.

The following code example demonstrates a custom site map provider implementation and shows how to use the SiteMapNodeCollection constructor to create a new SiteMapNodeCollection and add elements to the SiteMapNodeCollection with the Add method.

This code example is part of a larger code example provided for the SiteMapProvider class.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: