protected void GridView1_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) { //int city_id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString()); GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex]; Label lbl_id = (Label)row.FindControl("lbl_eccid"); TextBox txt_ccode = (TextBox)row.FindControl("txt_ccode"); TextBox txt_cname = (TextBox)row.FindControl("txt_cname"); GridView1.EditIndex = -1; int i = bl.update_country_code(Convert.ToInt32(lbl_id.Text), txt_ccode.Text, txt_cname.Text); databind_country_code(); }