protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { int id = int.Parse(GridView1.Rows[e.RowIndex].Cells[0].Text); Control control = GridView1.Rows[e.RowIndex].Cells[1].Controls[0]; TextBox textBox = (TextBox)control; string str = textBox.Text; Control control2 = GridView1.Rows[e.RowIndex].Cells[2].Controls[0]; TextBox textBox2 = (TextBox)control; string str1 = textBox.Text; UserInfo user = new UserInfo(); user.userName = str; user.userPassword = str1; user.userId = id; if (AddUserBll.UpdateUserOK(user)) { Response.Write("<script>alert('ok')</script>"); bin(); } }