Assembly: System.Web (in system.web.dll)
public ref class SiteMapNodeCollection : IHierarchicalEnumerable, IList, ICollection, IEnumerable
public class SiteMapNodeCollection implements IHierarchicalEnumerable, IList, ICollection, IEnumerable
The SiteMapNodeCollection class provides a strongly typed collection for SiteMapNode objects. It stores SiteMapNode objects internally in a zero-based array.
You can modify a SiteMapNodeCollection collection when it is first created, and then use the following methods to add, copy, and remove SiteMapNode objects:
To copy SiteMapNode objects, use the CopyTo method.
To remove SiteMapNode objects, use the Remove method.
You can create a read-only SiteMapNodeCollection, which does not permit adding, copying, nor removing SiteMapNode objects, by using the static ReadOnly method. The SiteMapNodeCollection collections that are returned by the SiteMapNode.GetAllNodes and GetChildren methods are read-only, as is the SiteMapNodeCollection that is returned when the ChildNodes property is accessed on a SiteMapNode object that is returned from a provider. A NotSupportedException exception is thrown, if you attempt to modify a read-only SiteMapNodeCollection by setting the default indexer property or by using any of the following methods:
Use the IsReadOnly property to check the collection before calling any of the methods in the preceding list.
The following code example demonstrates how to create a SiteMapNodeCollection collection, and then add SiteMapNode objects to it using the AddRange method. The SiteMapNodeCollection is a subset of the current site map, showing only the first two hierarchical levels.
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.