protected void btnDelete_Click(object sender, EventArgs e) { int id = Convert.ToInt32((sender as LinkButton).CommandArgument); bool res = false; try { ChatLieu.ChatLieu_Delete(id); res = true; Clear(); } catch (SqlException ex) { Console.WriteLine(ex.Message); res = false; } if (res == true) { lbSuccess.Text = "Deleted successfully!!"; } else { lbError.Text = "There's something wrong. We cannot save your work"; } }