protected void btnDeleteExercise_Click(object sender, EventArgs e) { ExerciseManager deleter = new ExerciseManager(); try { bool result = deleter.deleteExerciseByName(ExerciseDDL.SelectedValue); if (result) { lblDeletionResult.Text = "The exercise has been removed"; Response.Redirect("default.aspx"); } else { lblDeletionResult.Text = "Something went wrong with the database deletion"; } } catch (Exception) { lblDeletionResult.Text = "Something went wrong with the execution of the page"; } }
protected void btnDeleteExercise_Click(object sender, EventArgs e) { ExerciseManager deleter = new ExerciseManager(); try { bool result = deleter.deleteExerciseByName(viewExercises.ddlValue); if (result) { lblDeletionResult.Text = "The exercise has been removed"; lblDeletionResult.ForeColor = Color.Green; //Response.Redirect("default.aspx"); viewExercises.populateExiseList(); clearModifyForm(); populateForm(); } else { lblDeletionResult.Text = "Something went wrong with the database deletion"; lblDeletionResult.ForeColor = Color.Red; } } catch (Exception) { lblDeletionResult.Text = "Something went wrong with the execution of the page"; lblDeletionResult.ForeColor = Color.Red; } }