protected void Delete_Click(object sender, EventArgs e) { PRMS controller = new PRMS(); bool Success; Success = controller.DeleteProfession(Profession.SelectedValue); if (Success) { ClearForm(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Profession Deleted')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Profession not Deleted')", true); } }