select a specific Item???
How to select a specific Item in a DropDownList in asp.net?
using SelectedIndexChanged I can select any items in a DropDownList that i bind in my database but the result gives me the first item always which is the value of index 0 or first item.
the result should be whatever item that i selected in my DropDownList...
Re: select a specific Item???
VB Code:
s = lst.Items(lst.SelectedIndex).Text
Re: select a specific Item???
When i false my AutoPostBack properties, I can now select any item in my DropDownList.
How would i post the selected item to my textbox?
I tried this code in SelectedIndexChanged but it wont work at all.
"STRinfo.Text = STRinfo.SelectedItem.Value"
Re: select a specific Item???
VB Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Response.Write(drp.Items(drp.SelectedIndex).Text)
Response.Write(drp.SelectedItem.Text)
End Sub
I tried it and it works fine...
Re: select a specific Item???
it shud be something like this:
STRinfo.Text = dropdownname.SelectedValue