public ActionResult Edit(int id, detail ob) { try { using (SD info = new SD()) { info.Entry(ob).State = EntityState.Modified; info.SaveChanges(); } return(RedirectToAction("Index")); } catch { return(View()); } }