System.Web.UI.WebControls Namespace ListItemCollection Class
Determines whether the collection contains a specified item.
[ VB ]
Public Function FindByValue ( _
ByVal value As String _
) As ListItem
[ C# ]
public ListItem FindByValue (
string value
);
[ C++ ]
public: ListItem FindByValue (
String* value
);
[ JScript ]
public function FindByValue (
value : String
) : ListItem;
- value
- The value to search for.
A ListItem that contains the value specified by the value parameter.
Use the FindByValue method to search the collection for a ListItem with a Value property that contains value specified by the value parameter. If an item is not found in the collection using this criteria, a null reference ( Nothing in Visual Basic ) is returned.
The following examples demonstrate how to use the FindByValue method to programmatically set the Selected property of a ListItem object at run time.
ListItemCollection Members