p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

aspx thread: Select all checkboxes in checkboxlist control


Message #1 by "Carole D. Sullivan" <carolesullivan@e...> on Wed, 3 Jul 2002 17:54:09
I had a hard time finding this, so I thought it could hurt to post it.

I see alot of solutions for selecting all checkboxes that include 
javascript.  For ASPX code behind pages:

Add the control to select all checkboxes to your pages and change the 
AUTOPOSTBACK property to TRUE.

Then in the changed event for this checkbox:

Dim item
If cbSelectAllFunctions.Checked = True Then
    For item = 0 To cblstFunctions.Items.Count - 1
       cblstFunctions.Items.Item(item).Selected() = True
    Next
Else
    For item = 0 To cblstFunctions.Items.Count - 1
      cblstFunctions.Items.Item(item).Selected() = False
    Next
End If

  Return to Index