protected void btnRemove_Click(object sender, EventArgs e) { try { int id = -1; string _id = Request.QueryString["id"].ToString(); int.TryParse(_id, out id); int userId = CurrentEnvironment.LoggedUser.Id; int i = Dose.Remove(id); if (i > 0) { lblSuccess.Visible = true; lblWarning.Visible = false; lblError.Visible = false; gridview_Databind(id); ClearControls(this); } else { lblSuccess.Visible = false; lblWarning.Visible = true; lblError.Visible = false; } } catch (Exception ex) { lblSuccess.Visible = false; lblWarning.Visible = false; lblError.Visible = true; } }