public ActionResult DeleteConfirmed(int id) { int answerID; using (Repos repo = new Repos()) { answerID = repo.GetPictureByID(id).AnswerID; repo.DeletePicture(id); } return(RedirectToAction("edit", new { controller = "Answers", id = answerID })); }