我想在datalist 里面添加一个Checkbox,选中时,点击btnstate 就触发下面事件 ,可我单条语句运行,怎么选中,判断都为假?晕了,不知道什么原因,请高人指点protected void btnstate_Click(object sender, EventArgs e)
{
CheckBox chkbox;
for (int i = 0; i < dladdress.Items.Count; i++)
{
chkbox = (CheckBox)this.dladdress.Items[i].FindControl("chk1");
if (chkbox.Checked)
{
int id = dladdress.Items[i].ItemIndex;
......
}
else
{ }
}
}
{
CheckBox chkbox;
for (int i = 0; i < dladdress.Items.Count; i++)
{
chkbox = (CheckBox)this.dladdress.Items[i].FindControl("chk1");
if (chkbox.Checked)
{
int id = dladdress.Items[i].ItemIndex;
......
}
else
{ }
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货