System.Web.UI.WebControls.ListItemCollection.FindByText Method

Searches the collection for a System.Web.UI.WebControls.ListItem with a ListItem.Text property that equals the specified text.

Syntax

public ListItem FindByText (string text)

Parameters

text
The text to search for.

Returns

A System.Web.UI.WebControls.ListItem that contains the text specified by the text parameter.

Remarks

Use the ListItemCollection.FindByText(string) method to search the collection for a System.Web.UI.WebControls.ListItem with a ListItem.Text property that equals text specified by the text parameter. This method performs a case-sensitive and culture-insensitive comparison. This method does not do partial searches or wildcard searches. If an item is not found in the collection using this criteria, null 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