Hello,
I'm using a drop down list control on the page, and I databind it in this manner:
Code:
DropDownList1.DataSource = objDataSet
DropDownList1.DataMember = "DB"
DropDownList1.DataTextField = "name"
DropDownList1.DataValueField = "name"
DropDownList1.DataBind()
The problem I'm having is that of the 40+ records that are loaded into it, when I go to reference it in any of the ways below:
Code:
DropDownList1.SelectedValue
DropDownList1.SelectedItem.Text
DropDownList1.SelectedItem.Value
DropDownList1.SelectedIndex
I only get the first entry. The selected index is zero, and the values and text values is only the first one, no matter what record I have selected. I've tested the SelectedIndexChanged with the AutoPostback to true, and when the index changed, it did post back. But even then, the value was still 0 for the index.
Why is this happening?
Thanks,
Brian Mains