DropDownList values are case sensitive?

  • Thread starter Boban Dragojlovic
  • Start date
B

Boban Dragojlovic

Say I have a dropdownlist control of the US State Codes
<asp:dropdownlist id=ddlStateCode ...>
<asp:listitem value="AL">Alabama</asp:listitem>
<asp:listitem value="CA">California</asp:listitem>
etc...


In my codebehind, I have something like this:

ddlStateCode.SelectedValue = UserRecord.StateCode


the problem is that if the UserRecord.StateCode is not in caps, I get an
error. In other words, the 'SelectedValue' property is case sensitive.

I have tried using 'OPTION COMPARE TEXT' but it didn't help.

Is there a way of making it NOT be case sensitive?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top