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.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sanjeeb LenkaPosted Sep 2, 2013, 12:29 PM
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 KumarPosted Mar 2, 2023, 10:50 AM
protected void btnSelectAll_Click(object sender, EventArgs e)
{
foreach (ListItem liin CheckBox1.Items)
{
chk.Selected=true;
}
}