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

Recommended Answers

All 4 Replies

Thank u man i was in deep trouble with that problem.......

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

Where it uses:

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

Instead use:

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.