943,598 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Marked Solved
  • Views: 1563
  • ASP.NET RSS
Feb 19th, 2009
0

dropdownlist

Expand Post »
hi,
there...i need help.im not sure if my codes are appropriate..

asp.net Syntax (Toggle Plain Text)
  1. <asp'Label id:"lblreport" runat="server" text"type of report"></asp:Label>
  2. <asp:dropdownlist selected="true" value="annually"></asp:ListItem>
  3.  
  4. <asp:dropdownlist selected="true" value="Monthly"></asp:ListItem>
  5.  
  6. <asp:dropdownlist selected="true" value="weekly"></asp:ListItem>
  7.  
  8. <asp:dropdownlist selected="true" value="Daily"></asp:ListItem>
  9.  
  10. </asp:dropdownlist>
  11.  

im getting error telling 'cannot have multiple selection'.
Last edited by peter_budo; Feb 19th, 2009 at 4:08 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
chriscross86 is offline Offline
54 posts
since Feb 2009
Feb 19th, 2009
0

Re: dropdownlist

As your error message suggests, you cannot have multiple items selected on a Dropdownlist. You can set only one ListItem's Selected property to true, which will be the default selected Item of your Dropdownlist. Your Dropdownlist should be something similar like this:
ASP.NET Syntax (Toggle Plain Text)
  1.  
  2. <asp:DropDownList ID="DropDownList1" runat="server">
  3. <asp:ListItem Selected="True">Anually</asp:ListItem>
  4. <asp:ListItem>Monthly</asp:ListItem>
  5. <asp:ListItem>Weekly</asp:ListItem>
  6. <asp:ListItem>Daily</asp:ListItem>
  7. </asp:DropDownList>
Reputation Points: 16
Solved Threads: 18
Junior Poster
Aneesh_Argent is offline Offline
104 posts
since Dec 2008
Feb 19th, 2009
0

Re: dropdownlist

Hi..
In dropdown u dont have multiple selection.
If u want to select multiple items use the list control and set selection mode property as multiple.
Hope it'll help u...
Reputation Points: 10
Solved Threads: 1
Light Poster
sonakrish is offline Offline
34 posts
since Dec 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: How to set Global Variable
Next Thread in ASP.NET Forum Timeline: how to code





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC