DropDownList control question

  • Thread starter Thread starter Philip Townsend
  • Start date Start date
P

Philip Townsend

I have a dropdown list control and need to get its value. The dropdown
list is populated from a dataset, which gets its contents from sql
server.

I am using the following syntax: val=dd.SelectedItem.Value . The value
is getting populated, but will only return the value of the first item
on the list, regardless of any selection that has been made by an end
user. Any clues as to why this is happening?
 
you need to write a databind with for loop to find out the value of the DropDownListID.SelectedIndex

if you do not do databind, only the first item will be selected and so dd.SelectedItem.Value is first item
 
Back
Top