Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DROPDOWNLIST 2

Status
Not open for further replies.

Nsan

MIS
Apr 30, 2003
13
0
0
I cannot capture the value of an item selected from a dropdownlist. The value captured is always the first item in the drop down list..

Code:

If IsPostBack Then
txttech.Text = DropDownList1.SelectedItem.Text
End If
Response.Write(txttech.Text)

Thx
 
I've had success with a listbox using:

myListbox.SelectedValue

Hope this helps.

Thanks and best regards,
-Lloyd
 
I think even
DropDownList1.Items[SelectedIndex].Text or value should get you the value too
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top