foreach(GridViewRow item in GridView1.Rows)
{
CheckBox cb =(CheckBox)item.FindControl("ck");
if (cb.Checked)
{
string id="";
id += item.Cells[2].Text;
}
}
选了3个还是只能得到一个
为什么id不能进行累加
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
1条回答 默认 最新
GreenRookie 2016-07-26 03:50关注string id="";
foreach(GridViewRow item in GridView1.Rows)
{
CheckBox cb =(CheckBox)item.FindControl("ck");
if (cb.Checked)
{id += item.Cells[2].Text;
}
}
string id 你放里面了 每次都是重新定义了本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报