I have a checkbox inside a grid view.When i click on update button,i check at code behind which check boxes are checked to update record in db. butCheck box.checked property is always false.
for (int i = 0; i < gvUserInformation.Rows.Count; i++) { CheckBox chk = (CheckBox)gvUserInformation.Rows[i].Cells[0].FindControl("chkOpt1"); if (chk != null) { if (chk.Checked) {
int sno = int.Parse(gvUserInformation.Rows[i].Cells[1].Text); if (obj.UpdateDivision(sno, ddlDivision.SelectedItem.Text) > 0) { ClientScript.RegisterStartupScript(Page.GetType(), "divisionselection", "<script language='javascript'>alert('Updated successfully')</script>"); } } } }

Go to the complete details ...