public ActionResult Delete(int id, FormCollection collection) { try { js.deleteQuestionByID(id); return(RedirectToAction("Index")); } catch { Question job = js.getQuestionByID(id); ViewBag.StatusMessage = "WARNING! Cannot delete questions associated with Job Templates"; if (job == null) { return(HttpNotFound()); } return(View(job)); } }