Cassio
Well-known member
How can I retrieve the selected item from a listbox in ASP.NET?
I tried this:
and this:
And when I select an item and press the button it is like no item has been selected.
I tried this:
Code:
Dim i As Integer
For i = 0 To lstProdutos.Items.Count - 1
If lstProdutos.Items(i).Selected Then
Response.Write(i)
End If
Next
and this:
Code:
Response.Write(lstProdutos.SelectedItem.Text)
And when I select an item and press the button it is like no item has been selected.