protected void m_grid_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { int id = e.RowIndex; m_grid.EditIndex = id; GridViewRow row = m_grid.Rows[id]; string DoiTac = ((DropDownList)row.FindControl("txtUDoiTac")).Text; string Vung = ((DropDownList)row.FindControl("txtUVung")).Text; // short updateId = Int16.Parse(m_grid.DataKeys[id].Value.ToString()); if (m_grid.DataKeys[id].Value.ToString()!= "") { clsDoiTac_Vung objDoiTacVung = new clsDoiTac_Vung(); objDoiTacVung.DoiTac_Vung_Id = m_grid.DataKeys[id].Value.ToString(); objDoiTacVung.DoiTac_Id = DoiTac; objDoiTacVung.Vung_Id = Vung; int _result = objDoiTacVung.Update(); if (_result == 1) { ltlAnnouncement.Text = "Sửa thành công!"; } if (_result < 0) { ltlAnnouncement.Text = "Có lỗi trong quá trình sửa dữ liệu!"; } } } catch (Exception ex) { ltlAnnouncement.Text = "Khong cap nhat duoc du lieu. Vui long lien he voi quan tri<br>" + ex.Message; } bindData(-1); }