System.Web.UI.WebControls.MenuItemCollection.IndexOf Method

Determines the index of the specified System.Web.UI.WebControls.MenuItem object in the collection.

Syntax

public int IndexOf (MenuItem item)

Parameters

item
Documentation for this section has not yet been entered.

Returns

The zero-based index of the first occurrence of value within the current System.Web.UI.WebControls.MenuItemCollection, if found; otherwise, -1.

Remarks

Use the MenuItemCollection.IndexOf(MenuItem) method to determine the index of the specified System.Web.UI.WebControls.MenuItem object in the current System.Web.UI.WebControls.MenuItemCollection object. If the menu item is not in the collection, the method returns -1.

Note:

If the specified menu item appears multiple times in the collection, the index of the first occurrence is returned.

Requirements

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