ASP.NET ListItem Value Property
ListItem control
Definition and Usage
The Value property is used to set or return the value of the ListItem control.
Syntax
/> The text of the displayed list item may be set using the Text or Value property and the inner HTML text. Depending on the combination of the Text or Value property and the inner HTML text, different text can be displayed and different values can be used. The table below lists all possible combinations and their values: **Note:** Because both the Text and Value properties have an empty-string default value, list controls may contain empty list items. The following example sets the value of a ListItem in a ListBox control: Demo Example »
property
Description
string
A string value that specifies the value of the ListItem control.
Example
Inner HTML
Text property
Value property
Displayed text
Value used
Set
Set
Set
Inner HTML
Value property
Set
Set
Not set
Inner HTML
Inner HTML
Set
Not set
Set
Inner HTML
Value property
Set
Not set
Not set
Inner HTML
Inner HTML
Not set
Set
Set
Text property
Value property
Not set
Set
Not set
Text property
Text property
Not set
Not set
Set
Value property
Value property
Not set
Not set
Not set
Not set
Not set
Tips and Notes
Example
ListItem control