public ActionResult Edit(Guid id, FormCollection collection) { try { dc.Post_Update(id, collection["Title"], collection["Abstract"], collection["Body"], Guid.Parse(collection["Group"])); return(RedirectToAction("Index")); } catch { var Post = dc.Posts.Where(x => x.Id == id).FirstOrDefault(); if (Request.IsAjaxRequest()) { return(PartialView(Post)); } return(View(Post)); } }