System.Web.UI.WebControls.MenuItemCollection.CopyTo Method

Copies all the items from the System.Web.UI.WebControls.MenuItemCollection object to a compatible one-dimensional array of System.Web.UI.WebControls.MenuItem objects, starting at the specified index in the target array.

Syntax

public void CopyTo (MenuItem[] itemArray, int index)

Parameters

itemArray
Documentation for this section has not yet been entered.
index
The position in the target array at which to start receiving the copied content.

Remarks

Use the MenuItemCollection.CopyTo(MenuItem[], int) method to copy the contents of the current System.Web.UI.WebControls.MenuItemCollection object into the specified zero-based array. Items are copied starting at the specified index of the target array. With the array, you can then use array syntax to access the items in the System.Web.UI.WebControls.MenuItemCollection object.

As an alternative, you can also use the MenuItemCollection.GetEnumerator method to create an enumerator that can be used to access the items in the collection.

Requirements

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