rgrimm
asked on
ASP.Net/VB.Net/DataList: How to reset all the checkboxes in a datalist
I have a web form that contains a datalist. Each cell of the datalist contains a checkbox. It looks something like this:
[ ] Select All
-----------------
[ ] Person A
[ ] Person B
[ ] Person C
[ ] Person D
The CheckBox.Text property gets its name from databinding to a Name field in a database. The checkbox value is unbound. What I intend to do is insert records into a table for each checked box.
When I turn on the Select All checkbox at the top I want all of the other check boxes to be turned on, and vice versa. What is the code for doing this?
[ ] Select All
-----------------
[ ] Person A
[ ] Person B
[ ] Person C
[ ] Person D
The CheckBox.Text property gets its name from databinding to a Name field in a database. The checkbox value is unbound. What I intend to do is insert records into a table for each checked box.
When I turn on the Select All checkbox at the top I want all of the other check boxes to be turned on, and vice versa. What is the code for doing this?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ya it is also work
your idea is good, but because of "AutoPostback = true " it will need an extra trip to the server. and I guess it is not at all necessary just to check the CheckBoxes. Javascript will work at the client side and will save you from that extra postback
-Baan