Am dynamically filling a ListBox with values from backend.
Please go thro the following sample code:
ListBox1.Items.Add(New ListItem("text1", "value1"))
ListBox1.Items.Add(New ListItem("text2", "value2"))
ListBox1.Items.Add(New ListItem("text3", "value3"))
I select the third item and click on the button.
The problem is: as soon as i click on the button,
the selection is lost and the first item is
I dont get this problem on using:
But i need to have the value property to identify
each listitem separately.
PLEASE NOTE that i have set AutoPostBack of Listbox
to false and EnableViewState to true.
Can someone please tell me why this happens?