ASP:CheckBox获取前台的checked的属性

后台代码:

for (int i = 0; i < this.GvCourses.Rows.Count; i++)
{
    CheckBox chb = this.GvCourses.Rows[i].FindControl("CheckB") as CheckBox;
    if (chb.Checked)
    {
        strDelete += "," + this.GvCourses.Rows[i].Cells[0].Text;
    }
}

 

前台代码:

<asp:CheckBox runat="server" ID="CheckB" />

 

posted @ 2016-07-30 09:39  爛轲  阅读(709)  评论(0编辑  收藏  举报