0

How to store list item in order of the listitems selected?
Ex: Hindi,English,Telugu,Social............ these are items in checkboxlist, now when i select telugu that value should be stored as 1 and then if i select english that value should be stored as 2,so that we can know the order of selection.If we know that then we can store those values in database.Please help..............

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by shibbard
0

i was just wondering. what if i want the value instead of the text item. lets say.

<asp:CheckBoxList ID="cblPlanets" runat="server" Width="109px">
    <asp:ListItem Value="1">Mercury</asp:ListItem>
    <asp:ListItem Value="2">Venus</asp:ListItem>
    <asp:ListItem Value="3">Earth</asp:ListItem>
    <asp:ListItem Value="4">Mars</asp:ListItem>
    <asp:ListItem Value="5">Jupiter</asp:ListItem>
    <asp:ListItem Value="6">Saturn</asp:ListItem>
</asp:CheckBoxList>

and i want it to display

You selected:
1
2
3
6

for e.g

0

Where it uses:

Label1.Text += li.Text + "<br />";

Instead use:

Label1.Text += li.Value + "<br />";

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.