By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,638 Members | 2,204 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,638 IT Pros & Developers. It's quick & easy.

checkbox in datalist with C#

P: 23
i have checkbox in datalist and i need to find which checkbox is checked
name of checkbox = CheckBox1
and name of datalist is DataList1

i am writng this code to find the checked checkbox

foreach (DataListItem dli in DataList1.Items)
{

bool ok = ((CheckBox)dli.FindControl("CheckBox1")).Checked;
if (ok)
{
// ok
}
}


but the result is always false what i have to do


10x
Oct 15 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.