public ActionResult EditPost(int?id, Author au) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } using (AuthorDAL service = new AuthorDAL()) { try { service.Edits(id.Value, au); TempData["Message"] = Helper.MsgBox.GetMsg("success", "Success! ", "Your data has been updated"); } catch (Exception ex) { TempData["Message"] = Helper.MsgBox.GetMsg("danger", "Error", ex.Message); } } return(RedirectToAction("Index")); }