我的代码:
foreach (DataListItem Item in DataList1.Items)
{
CheckBox cbox = (CheckBox)Item.FindControl("CheckBox1");
Label lab_test = (Label)Item.FindControl("Label7");
if (cbox.Checked == true)
{
lab_test.Text = "aaa";
}
}
我设置了断点查看,无论是否选了CheckBox,CheckBox的checked一直为false。
这里出了什么问题?求帮助。
foreach (DataListItem Item in DataList1.Items)
{
CheckBox cbox = (CheckBox)Item.FindControl("CheckBox1");
Label lab_test = (Label)Item.FindControl("Label7");
if (cbox.Checked == true)
{
lab_test.Text = "aaa";
}
}
我设置了断点查看,无论是否选了CheckBox,CheckBox的checked一直为false。
这里出了什么问题?求帮助。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货