public ActionResult Edit(string id, AReg reg) { try { if (ModelState.IsValid) { BTourGuideOp tourOp = new BTourGuideOp(); reg.RegID = id; tourOp.EditReg(reg); return RedirectToAction("Index"); } else return View(reg); } catch(Exception e) { TempData["EditException"] = "Error in Reg edit: " + e.Message; return View(reg); } }