日期:2014-05-17 浏览次数:20399 次
for (int i = 0; i < GridView1.Rows.Count; i++) { CheckBox cb = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("ck1"); if (cb.Checked) { //这里写插入到tabel2代码 } }
------解决方案--------------------
for (int i = 0; i < GridView1.Rows.Count; i++) { CheckBox cb = GridView1.Rows[i].FindControl("CheckBox1") as CheckBox; if (cb.Checked) { 插入table表; } }
------解决方案--------------------
for (int i = 0; i < DataList1.Items.Count; i++)
{
CheckBox cb = DataList1.Items[i].FindControl("CheckBox1") as CheckBox;
if (cb.Checked)
{
插入table表;
}
}