Click to See Complete Forum and Search --> : DropDownList Problem


flappie
March 7th, 2003, 11:38 PM
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

anupam kant
March 10th, 2003, 06:16 AM
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'