-
DropDownList Problem
I am experiencing a problem with a dropdownlist box.
The list box has been bound to a dataset to call its information from a database.
It presents all the information in the dropdown from the selected table.
When I click the button that I have created I run the code:
Dim strCatagory As String = ddlCatOption.SelectedItem.Value
lblTest.Text = strCatagory
Now the problem,
Whenever I run this it present the first item in the drop down list to me as the strCatagory, irrespective if I selected the 2nd, third or foutth item in the list.
I hope you can help.
Thanks
-
Check if you are filling the dropdown every time the page got submitted...
I guess the dropdown is filling again when you press the button..
If it is then execute that code only when 'Page.isPostBack' is 'false'