This documentation is archived and is not being maintained.

ListItemCollection.IndexOf Method

Determines the index value that represents the position of the specified ListItem in the collection.

[Visual Basic]
Public Function IndexOf( _
   ByVal item As ListItem _
) As Integer
[C#]
public int IndexOf(
 ListItem item
);
[C++]
public: int IndexOf(
 ListItem* item
);
[JScript]
public function IndexOf(
   item : ListItem
) : int;

Parameters

item
A ListItem to search for in the collection.

Return Value

The index position of the specified ListItem in the collection.

Remarks

Use the IndexOf method to determine the index value of the 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

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

ListItemCollection Class | ListItemCollection Members | System.Web.UI.WebControls Namespace

Show: