Retrieving Values from a drop down box.

  • Thread starter Thread starter TG
  • Start date Start date
T

TG

How do I get the value from the selection in a drop down box and pass
that value on to another part of the application? For example from
the drop down box to a textbox. I need this for ASP.NET/VB.NET

thanks
Terry
 
TG

Why do you not use the Dropdownlist instead of the HTML dropdown?

Cor
 
TG
That is what I meant. How do you do it?
By instance in this way.

\\\
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Me.DropDownList1.AutoPostBack = True
End If
End Sub
Private Sub DropDownList1_SelectedIndexChanged _
(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles DropDownList1.SelectedIndexChanged
TextBox1.Text = DropDownList1.SelectedItem.ToString
End Sub
///
I hope this helps

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top