System.Web.UI.WebControls.MenuItemCollection.Add Method

Appends the specified System.Web.UI.WebControls.MenuItem object to the end of the current System.Web.UI.WebControls.MenuItemCollection object.

Syntax

public void Add (MenuItem child)

Parameters

child
The System.Web.UI.WebControls.MenuItem to append to the end of the current System.Web.UI.WebControls.MenuItemCollection.

Remarks

Use the MenuItemCollection.Add(MenuItem) method to append the specified System.Web.UI.WebControls.MenuItem object to the end of the collection.

Note:

You can add null values and duplicate System.Web.UI.WebControls.MenuItem objects to the collection.

As an alternative, you can insert a System.Web.UI.WebControls.MenuItem object in the collection at a specific index by using the MenuItemCollection.AddAt(int, MenuItem) method.

Requirements

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