Select All CheckBox Value
I have One CheckboxList and one button. I want that when i click on button, it will select all checkbox values. Can anyone help me on these. Please check my attached code.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 2, 2013, 8:29 AM EDT
take one button and write the code in button click event.
protected void btnSelectAll_Click(object sender, EventArgs e)
{
foreach (ListItem chk in chklstRecipientsFromDB.Items)
{
chk.Selected=true;
}
}
Happy coding.....
Rajeev KumarRank #1,334 · 1.3K reputationPosted Mar 2, 2023, 5:50 AM EST
protected void btnSelectAll_Click(object sender, EventArgs e)
{
foreach (ListItem liin CheckBox1.Items)
{
chk.Selected=true;
}
}