SiteMapNodeCollection::Item Property
Gets or sets the SiteMapNode object at the specified index in the collection.
Assembly: System.Web (in System.Web.dll)
public: virtual property SiteMapNode^ Item[int index] { SiteMapNode^ get (int index); void set (int index, SiteMapNode^ value); }
Parameters
- index
- Type: System::Int32
The index of the SiteMapNode to find.
Property Value
Type: System.Web::SiteMapNodeA SiteMapNode that represents an element in the SiteMapNodeCollection.
| Exception | Condition |
|---|---|
| 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 nullptr. |
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.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.