SiteMapNodeCollection.Item Property

Gets or sets the SiteMapNode object at the specified index in the collection.

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

public:
virtual property SiteMapNode^ default [int] {
	SiteMapNode^ get (int index);
	void set (int index, SiteMapNode^ value);
}
/** @property */
public SiteMapNode get_Item (int index)

/** @property */
public void set_Item (int index, SiteMapNode value)

Not applicable.

Parameters

index

The index of the SiteMapNode to find.

Property Value

A SiteMapNode that represents an element in the SiteMapNodeCollection.

Exception typeCondition

NotSupportedException

The SiteMapNodeCollection is read-only.

ArgumentOutOfRangeException

index is less than zero.

- or -

index is great than the Count.

ArgumentNullException

The value supplied to the setter is a null reference (Nothing in Visual Basic).

You can use the Item indexer to iterate over the contents of a SiteMapNodeCollection collection or to replace the SiteMapNode object at a specified index.

The following code example demonstrates how to use the Item indexer to retrieve a SiteMapNode object from the SiteMapNodeCollection collection. In this example, a SiteMapNode object is removed from its position at the second element of the internal array using the Remove method and is appended to the array with the Add method. To insert a SiteMapNode object at a specific index, instead of appending it to the end of the array, use the Insert method.

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

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: