Selected ListItem in DropDownList does not appear selected

  • Thread starter Nathan Sokalski
  • Start date
N

Nathan Sokalski

I have a DropDownList in which I set the SelectedIndex property in my code.
However, when I run a debug it does not appear selected (actually, none of
the ListItems are even visible in the DropDownList until I click the arrow
to select one). However, when I do a view source it has the following:

<select name="ctl00$cphContent$dtpBothAMPM$ddlAMPM"
id="ctl00_cphContent_dtpBothAMPM_ddlAMPM">
<option value="AM">AM</option>
<option selected="selected" value="PM">PM</option>
</select>

As you can see, not only are the option tags there, but one of them (the one
I set to be selected in my codebehind) has the selected="selected"
attribute. Why is it not appearing selected like all the other DropDownLists
I set the SelectedIndex for? Thanks.
 

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

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top