Checkbox in ListBox

Discussion in 'ASP .Net' started by Edmilson, Jun 27, 2003.

  1. Edmilson

    Edmilson Guest

    Hello All

    I have a Datalist where each "Item" contains a checkbox (among other
    things). I want the user to be able to click on one or more
    checkboxes, click the Send button, and have something done to the
    Items that had the check boxes selected. Seems like a common task. I
    was easily able to do something like this in classic ASP. But I'm
    lost in ASP.NET.

    I´m using VB and I hope you can point me in the right direction...

    tks all
    troqui
    Edmilson, Jun 27, 2003
    #1
    1. Advertising

  2. Edmilson

    Edmilson Guest

    Sorry, the correct subject should be Checkbox in Datalist

    "Edmilson" <> escreveu na mensagem
    news:...
    > Hello All
    >
    > I have a Datalist where each "Item" contains a checkbox (among other
    > things). I want the user to be able to click on one or more
    > checkboxes, click the Send button, and have something done to the
    > Items that had the check boxes selected. Seems like a common task. I
    > was easily able to do something like this in classic ASP. But I'm
    > lost in ASP.NET.
    >
    > I´m using VB and I hope you can point me in the right direction...
    >
    > tks all
    > troqui
    >
    >
    Edmilson, Jun 27, 2003
    #2
    1. Advertising

  3. You might try something like this, in your event handler or IsPostBack
    section of your Page_Load...

    For Each obj In dlist.Items
    If obj.GetType Is System.Web.UI.WebControls.CheckBox Then
    checkbox = CType(obj,
    System.Web.UI.WebControls.CheckBox)
    If checkbox.Checked Then
    Response.Write("You checked #" & checkbox.ID)
    End If
    End If
    Next


    Hope that helps.



    Charlie Nilsson [msft]
    Visual Studio Update

    --

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at
    http://www.microsoft.com/info/cpyright.htm

    Note: For the benefit of the community-at-large, all responses to this
    message are best directed to the newsgroup/thread from which they
    originated.
    --------------------
    > From: "Edmilson" <>
    > References: <>
    > Subject: Re: Checkbox in ListBox
    > Date: Fri, 27 Jun 2003 08:56:30 -0300
    > Lines: 21
    > X-Priority: 3
    > X-MSMail-Priority: Normal
    > X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
    > X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
    > Message-ID: <OSBi#>
    > Newsgroups: microsoft.public.dotnet.framework.aspnet
    > NNTP-Posting-Host: apolo.padtec.com.br 200.228.158.130
    > Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
    > Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:155398
    > X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >
    > Sorry, the correct subject should be Checkbox in Datalist
    >
    > "Edmilson" <> escreveu na mensagem
    > news:...
    > > Hello All
    > >
    > > I have a Datalist where each "Item" contains a checkbox (among other
    > > things). I want the user to be able to click on one or more
    > > checkboxes, click the Send button, and have something done to the
    > > Items that had the check boxes selected. Seems like a common task. I
    > > was easily able to do something like this in classic ASP. But I'm
    > > lost in ASP.NET.
    > >
    > > I´m using VB and I hope you can point me in the right direction...
    > >
    > > tks all
    > > troqui
    > >
    > >

    >
    >
    >
    Charlie Nilsson [MSFT], Jun 27, 2003
    #3
    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. blenderdude
    Replies:
    0
    Views:
    841
    blenderdude
    Aug 3, 2003
  2. DC Gringo
    Replies:
    0
    Views:
    393
    DC Gringo
    Apr 6, 2004
  3. kent
    Replies:
    1
    Views:
    867
    Andrew de la Harpe
    May 3, 2004
  4. Simon Prince
    Replies:
    2
    Views:
    3,314
    =?Utf-8?B?TWljaGFlbCBUYXlsb3I=?=
    Oct 19, 2004
  5. Chris Kettenbach

    Listbox selection to populate another listbox?

    Chris Kettenbach, Jun 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,637
    Chris Kettenbach
    Jun 16, 2005
Loading...

Share This Page