System.Web.UI.WebControls.ListItemCollection.IndexOf Method

Determines the index value that represents the position of the specified System.Web.UI.WebControls.ListItem in the collection.

Syntax

public int IndexOf (ListItem item)

Parameters

item
A System.Web.UI.WebControls.ListItem to search for in the collection.

Returns

The index position of the specified System.Web.UI.WebControls.ListItem in the collection.

Remarks

Use the ListItemCollection.IndexOf(ListItem) method to determine the index value of the System.Web.UI.WebControls.ListItem specified by the item parameter in the collection. If an item with this criteria is not found in the collection, -1 is returned.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0