954,577 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

dropdownlist

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

<asp'Label id:"lblreport" runat="server" text"type of report"></asp:Label>
<asp:dropdownlist selected="true" value="annually"></asp:ListItem>

<asp:dropdownlist selected="true" value="Monthly"></asp:ListItem>

<asp:dropdownlist selected="true" value="weekly"></asp:ListItem>

<asp:dropdownlist selected="true" value="Daily"></asp:ListItem>

</asp:dropdownlist>


im getting error telling 'cannot have multiple selection'.

chriscross86
Junior Poster in Training
54 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

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:DropDownList ID="DropDownList1" runat="server">
            <asp:ListItem Selected="True">Anually</asp:ListItem>
            <asp:ListItem>Monthly</asp:ListItem>
            <asp:ListItem>Weekly</asp:ListItem>
            <asp:ListItem>Daily</asp:ListItem>
</asp:DropDownList>
Aneesh_Argent
Junior Poster
104 posts since Dec 2008
Reputation Points: 16
Solved Threads: 18
 

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...

sonakrish
Light Poster
34 posts since Dec 2008
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You