System.Web.UI.WebControls.MenuItemStyleCollection.IndexOf Method

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

Syntax

public int IndexOf (MenuItemStyle style)

Parameters

style
The System.Web.UI.WebControls.MenuItemStyle to locate.

Returns

The zero-based index of the first occurrence of the specified System.Web.UI.WebControls.MenuItemStyle, if found; otherwise, -1.

Remarks

Use the MenuItemStyleCollection.IndexOf(MenuItemStyle) method to determine the zero-based index of the specified System.Web.UI.WebControls.MenuItemStyle object in the collection. If the node is not in the collection, the method returns -1.

Note:

If the specified System.Web.UI.WebControls.MenuItemStyle object 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