[thelist] (ASP.NET) Drop Down List Value/Text

Tab Alleman talleman at Lumpsum.com
Mon Oct 10 10:43:31 CDT 2005


I have a web form with a couple of drop down lists.  Some are populated by static arrays, and one is populated by a database table.  The population is working fine, but when I select an item on the list and then click the form's submit button, I'm not able to read the selected value of any of the lists.  The default value is being returned.

In the submit button onClick handler, I try to access a drop down list like this:

lbNameSuffix.SelectedItem.Text
lbState.SelectedItem.Value

I've also tried:
lbState.SelectedValue
lbNameSuffix.Items(lbNameSuffix.SelectedIndex).Text

But they always return the first value in the list, rather than the text/value of the item I selected.  This occurs regardless of whether I set the EnableViewState to true or false on the drop downs.  Any thoughts on why this would be happening?  


More information about the thelist mailing list