System.Web.UI.WebControls.MenuItemCollection.Clear Method

Removes all items from the current System.Web.UI.WebControls.MenuItemCollection object.

Syntax

public void Clear ()

Remarks

Use the MenuItemCollection.Clear method to remove every System.Web.UI.WebControls.MenuItem object from the current System.Web.UI.WebControls.MenuItemCollection object.

Note:

To remove an individual node from the collection, consider using the MenuItemCollection.Remove(MenuItem) or the MenuItemCollection.RemoveAt(int) method.

Requirements

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