S
somersbar
im trying to get a selected item from a dropdownlist(which is populated
from a microsoft access database) to appear in a textbox. i have set
autopostback to true for the dropdownlist, but no matter what item i
select from the list, its always only the first item in the list that
gets sent to the textbox. Do i need to use session variables or
something to store the values and then reload them in the pageLoad
fuction. i tried this but it didnt seem to work. can anyone help
please?
this is my code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
AreasDataSet11.Clear()
OdbcDataAdapter1.Fill(AreasDataSet11)
DropDownList1.DataBind()
End Sub
Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
DropDownList1.SelectedIndexChanged
TextBox1.Text = DropDownList1.SelectedValue
End Sub
from a microsoft access database) to appear in a textbox. i have set
autopostback to true for the dropdownlist, but no matter what item i
select from the list, its always only the first item in the list that
gets sent to the textbox. Do i need to use session variables or
something to store the values and then reload them in the pageLoad
fuction. i tried this but it didnt seem to work. can anyone help
please?
this is my code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
AreasDataSet11.Clear()
OdbcDataAdapter1.Fill(AreasDataSet11)
DropDownList1.DataBind()
End Sub
Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
DropDownList1.SelectedIndexChanged
TextBox1.Text = DropDownList1.SelectedValue
End Sub