System.Web.SiteMapNodeCollection Class

Provides a strongly typed collection for System.Web.SiteMapNode objects and implements the System.Web.UI.IHierarchicalEnumerable interface to support navigating through the collection.

See Also: SiteMapNodeCollection Members


public class SiteMapNodeCollection : IList, System.Web.UI.IHierarchicalEnumerable


The System.Web.SiteMapNodeCollection class provides a strongly typed collection for System.Web.SiteMapNode objects. It stores System.Web.SiteMapNode objects internally in a zero-based array.

You can modify a System.Web.SiteMapNodeCollection collection when it is first created, and then use the following methods to add, copy, and remove System.Web.SiteMapNode objects:

You can create a read-only System.Web.SiteMapNodeCollection, which does not permit adding, copying, nor removing System.Web.SiteMapNode objects, by using the static SiteMapNodeCollection.ReadOnly(SiteMapNodeCollection) method. The System.Web.SiteMapNodeCollection collections that are returned by the SiteMapNode.GetAllNodes and System.Web.UI.IHierarchyData.GetChildren methods are read-only, as is the System.Web.SiteMapNodeCollection that is returned when the SiteMapNode.ChildNodes property is accessed on a System.Web.SiteMapNode object that is returned from a provider. A NotSupportedException exception is thrown, if you attempt to modify a read-only System.Web.SiteMapNodeCollection by setting the default indexer property or by using any of the following methods:

Use the SiteMapNodeCollection.IsReadOnly property to check the collection before calling any of the methods in the preceding list.


Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions:
Since: .NET 2.0