Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Selected ListItem in DropDownList does not appear selected

Reply
Thread Tools

Selected ListItem in DropDownList does not appear selected

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      10-05-2008
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.
--
Nathan Sokalski
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selected ListItem in DropDownList does not appear selected Nathan Sokalski ASP .Net Web Controls 0 10-05-2008 10:29 PM
<asp:ListItem Value="0">blank choice</asp:ListItem> ? Jim in Arizona ASP .Net 7 11-22-2006 08:31 AM
ERROR: Literal content ('<asp:ListItem Selected="') is not allowed within a 'System.Web.UI.WebControls.ListItemCollection' (REPOST) John Smith ASP .Net 0 06-07-2006 07:24 AM
Literal content ('<asp:ListItem Selected="') is not allowed within a 'System.Web.UI.WebControls.ListItemCollection' John Smith ASP .Net 0 06-06-2006 07:58 AM
ropdownlist listitem.value not working - returns listitem.text instead Mad Scientist Jr ASP .Net 2 06-29-2004 01:13 PM



Advertisments