您如何通过 RedirectAction 方法将模型从 (GetDate) 操作传递到另一个 (ProcessP) 操作?
这是源代码:
[HttpPost]
public ActionResult GetDate(FormCollection values, DateParameter newDateParameter)
{
if (ModelState.IsValid)
{
return RedirectToAction("ProcessP");
}
else
{
return View(newDateParameter);
}
}
public ActionResult ProcessP()
{
//Access the model from GetDate here??
var model = (from p in _db.blah
orderby p.CreateDate descending
select p).Take(10);
return View(model);
}