public IActionResult Delete(string service) { var idService = Guid.Parse(_protector.Unprotect(service)); _serviceBusiness.DeleteService(idService, ApplicationUserCurrent.AccountId); return(RedirectToAction("Index")); }
protected void imgbtnDelete_Click(object sender, ImageClickEventArgs e) { try { ImageButton ibRemove = (ImageButton)sender; HiddenField hf = (HiddenField)ibRemove.FindControl("hfServiceId"); SB.DeleteService(new Guid(hf.Value)); loadData(); pnlGreen.Visible = true; lblSuccess.Text = "A service has been deleted successfully."; hplnkGreen.Text = "Close and continue."; hplnkGreen.NavigateUrl = ""; } catch (Exception ex) { pnlRed.Visible = true; lblError.Text = ex.Message; hplnkRed.Text = "Close and continue."; hplnkRed.NavigateUrl = ""; } }