Hello: This may sound confusing, but I have dropdownlist and databinding it, and have set the DataTextField and DataValueField correctly, but on the page itself when I choose the text from the dropdown it acts wacky on some of the values and chooses another value. here is some code: aspx page <asp:dropDownList ID="outside_assoc_cities" runat="server" AutoPostBack="True" Enabled="False" DataTextField="city" DataValueField="mls_id" Visible="False"></asp:dropDownList> codebehind Protected Sub recip_form_type_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles recip_form_type.SelectedIndexChanged If recip_form_type.SelectedItem.Value <> "0" Then outside_assoc_cities.Enabled = True ElseIf recip_form_type.SelectedItem.Value = "0" Then outside_assoc_cities.Enabled = False outside_assoc_cities.SelectedIndex = "0" End If End Sub If anyone wants to see this wackiness, let me know so I can put it on a public site.
Hi binici, some times autopostback will give problem, it will not allow to select values some times, please make the autopostback to "false" then check it again i think problem will solve.
You might want to do a view source of your generated page to see what's actually in the dropdown ... Might be your values aren't unique or something ...
Generally, when working with controls, make sure to do: If IsPostBack then ' Get the Data ' FILL the control (Bind Data) End If This will allow you to keep your viewstate and only fill the control once