protected void DeleteTeste(int idTeste) { try { var Teste = new Teste(); Teste.IDTeste = idTeste; Teste.Delete(); GetTestes(); } catch (Exception err) { Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('" + FormatError.FormatMessageForJAlert(err.Message) + "')</script>"); } }