Posted on: 12/11/2014 2:55:51 PM | Views : 430

I have a checkbox under gridview. I want to call the ID of the checkbox from code-behind but I am getting error as
Object reference not set to an instance of an object. see the below code.
protected void btnUpdate_Click(object sender, EventArgs e) { CheckBox chkSelect = sender as CheckBox; GridView grd = chkSelect.Parent as GridView; if (chkSelect.Checked == true) { } else { Response.Write("<script>alert('Please select checkbox to update');</script>"); } }  

Go to the complete details ...