在我的编辑动作方法中,我想保存调用编辑动作时所做的所有更改。但我想我错过了一些想法。这是我正在尝试的。编辑ASP.NET MVC 3中的动作3
[HttpPost]
public ActionResult Edit(Person editPerson)
{
if (ModelState.IsValid)
{
// may be here I want to add soething
return RedirectToAction("Index");
}
else
{
return View(editPerson);
}
}
[HttpPost] public ActionResult Edit(Person editPerson) (ModelState.IsValid) { return RedirectToAction(“Index”);如果(ModelState.IsValid) } else { return View(editPerson); } } – Jash 2011-05-23 13:01:29