checkbox in datalist

Discussion in 'ASP .Net' started by =?Utf-8?B?TWlrZQ==?=, Sep 23, 2004.

  1. I have a datalist with checkboxes and what I want to do is, to allow the user
    select the check box(s) and click a button. When the click the button i want
    it to only show the items selected. Either open a new page with the selected
    items or hide the items not checked. Has anyone done this or can anyone point
    me to somewhere that shows this or something like this?
    thx
    =?Utf-8?B?TWlrZQ==?=, Sep 23, 2004
    #1
    1. Advertising

  2. Try this:

    protected void button1_Click(object s, EventArgs e)
    {
    int i = 0;
    while(i < checkBoxList1.Items.Count)
    {
    if(!checkBoxList1.Items.Selected)
    {
    checkBoxList1.Items.RemoveAt(i);
    continue;
    }
    i++;
    }
    }

    Greetings
    Martin
    "Mike" <> wrote in message
    news:...
    > I have a datalist with checkboxes and what I want to do is, to allow the

    user
    > select the check box(s) and click a button. When the click the button i

    want
    > it to only show the items selected. Either open a new page with the

    selected
    > items or hide the items not checked. Has anyone done this or can anyone

    point
    > me to somewhere that shows this or something like this?
    > thx
    Martin Dechev, Sep 24, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nevyn Twyll
    Replies:
    8
    Views:
    1,867
  2. tshad
    Replies:
    0
    Views:
    509
    tshad
    Apr 15, 2005
  3. Vikram

    disable checkbox list checkbox

    Vikram, Jan 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,383
    ThunderMusic
    Jan 25, 2006
  4. =?Utf-8?B?RG90TmV0RGV2?=

    DataGrid and embeded Checkbox..How to find if checkbox clicked

    =?Utf-8?B?RG90TmV0RGV2?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    806
    David Wier
    Oct 6, 2006
  5. Replies:
    1
    Views:
    449
Loading...

Share This Page