|
-
Apr 11th, 2003, 10:58 PM
#1
Thread Starter
New Member
Getting the selection from dropdownlist
I'm trying to get the value of the selection from the databound dropdownlist to be displayed in a textbox. Please help.
I have set the Autopostback property to true.
However, the value that is displayed in the textbox is always the first value from the database or rather the selected value is always the first value of the dropdownlist.
Here is the VB code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
OleDbDataAdapter1.Fill(DataSet11)
DropDownList1.DataBind()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
Dim str As String
str = DropDownList1.SelectedItem.Text
TextBox4.Text = str
End Sub
End Class
Please Help. Any assistance will be very much appreciated
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|