ListItemCollection.Contains Method (ListItem)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Determines whether the collection contains the specified item.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public bool Contains(
	ListItem item


Type: System.Web.UI.WebControls.ListItem

A ListItem to search for in the collection.

Return Value

Type: System.Boolean

true if the collection contains the specified item; otherwise, false.

Use the Contains method to determine whether the ListItem specified by the item parameter is in the collection.

.NET Framework
Available since 1.1
Return to top