public ActionResult Delete(Guid id) { var targets = new Targets(); var target = targets.GetTarget(id); try { targets.DeleteTarget(id); return RedirectToAction("Index", new { gid = target.GroupKey }); } catch (Exception ex) { ModelState.AddModelError("Error", ex.Message); var groups = new Groups(); var group = groups.GetGroup(target.GroupKey); var model = new TargetDetails() { Target = target, Group = group, }; return View("ConfirmDelete", model); } }