System.Web.UI.WebControls.MenuItemBindingCollection.Remove Method

Removes the specified System.Web.UI.WebControls.MenuItemBinding object from the collection.

Syntax

public void Remove (MenuItemBinding binding)

Parameters

binding
The System.Web.UI.WebControls.MenuItemBinding to remove from the collection.

Remarks

Use the MenuItemBindingCollection.Remove(MenuItemBinding) method to remove the specified menu item binding from the collection. All items that follow that menu item are then moved up to fill in the vacant position. The indexes of the moved items are also updated.

Note:

The collection can contain null values, as well as duplicate System.Web.UI.WebControls.MenuItemBinding objects.

As an alternative, you can remove a menu item from a specific index in the collection by using the MenuItemBindingCollection.RemoveAt(int) method. You can also remove all menu items from the collection by using the System.Web.UI.StateManagedCollection.Clear method.

Note:

The order in which System.Web.UI.WebControls.MenuItemBinding objects appear in the collection has no effect on how those objects are applied to the menu items in a System.Web.UI.WebControls.Menu control.

Requirements

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