public ActionResult DeleteConfirmed(int id) { if (System.IO.File.Exists(Server.MapPath(p.GetPageById(id).PageTitle))) { System.IO.File.Delete(Server.MapPath(p.GetPageById(id).PageTitle)); } p.DeletePageGroup(id); p.SavePage(); return(RedirectToAction("Index")); }