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_ecity_id"); TextBox txt_city = (TextBox)row.FindControl("txt_city_name"); GridView1.EditIndex = -1; int i = bl.update_city(Convert.ToInt32(lbl_id.Text), txt_city.Text); databind_city(); }