Skip to main content

Posts

Showing posts with the label Redesign

asp.net - How to find an item by value from a DropDownList

DropDownList FindByValue(String) Method DropDownList server control creates a single selection drop-down-list control. Asp.net developers can place ListItem objects between opening and closing tags of DropDownList control to specify list items. Each ListItem object represents a single item in DropDownList. Developers also can populate a DropDownList with items by using various data source controls such as SqlDataSource, LinqDataSource, ObjectDataSource, etc. ListItem represents a data item in DropDownList control. ListItem Text property gets or sets the text displayed in DropDownList and the Value property gets or sets the value associated with the ListItem. Value is hidden in the browser. We can find ListItem from a DropDownList Items collection programmatically by the specific ListItem value. DropDownList Items property gets the collection of items in DropDownList. The .net ListItemCollection class’s FindByValue() method searches a ListItem...