protected void gvDSClaim_RowUpdating(object sender, GridViewUpdateEventArgs e) { GridViewRow row = gvDSClaim.Rows[e.RowIndex]; TextBox txtmatruycap = row.Cells[3].Controls[0] as TextBox; string id = gvDSClaim.DataKeys[e.RowIndex].Value.ToString(); int mapub = int.Parse(txtmatruycap.Text); bool cn = cldao.CapNhatPub(id, mapub); if (cn == true) { e.Cancel = true; gvDSClaim.EditIndex = -1; loadDSClaim(); } else { Response.Write("<script> alert('Sorry :-(');</script>"); } }