G
Guest
Using Visual Studio.net 2003 to create an aspx web form I am having a
problem selecting an item from DropDownListBox with id= ListBoxStudies.
I can see the items from the bound database table but when I click on an item
the selected item stays at itemindex 0. What must I do to have the
itemindex change when I click on an item. What's missing from the following
code?
ListBoxStudies.DataSource = BICDataSet.Tables("protocols")
ListBoxStudies.DataTextField = "Study_name"
ListBoxStudies.DataValueField = "irb_number"
ListBoxStudies.DataBind()
I have tested this using a submit button and the _SelectedIndexchanged event
and I still always get selectedindex = 0.
Private Sub DropDownListStudies_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Dim study_name As String = Session("study_name")
study_name = ListboxStudies.SelectedItem.Text
End Sub
problem selecting an item from DropDownListBox with id= ListBoxStudies.
I can see the items from the bound database table but when I click on an item
the selected item stays at itemindex 0. What must I do to have the
itemindex change when I click on an item. What's missing from the following
code?
ListBoxStudies.DataSource = BICDataSet.Tables("protocols")
ListBoxStudies.DataTextField = "Study_name"
ListBoxStudies.DataValueField = "irb_number"
ListBoxStudies.DataBind()
I have tested this using a submit button and the _SelectedIndexchanged event
and I still always get selectedindex = 0.
Private Sub DropDownListStudies_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Dim study_name As String = Session("study_name")
study_name = ListboxStudies.SelectedItem.Text
End Sub