How to pass model data while redirecting to another action without using TemptData, as given in the example. Is there an alternate way to pass EmployeeViewModel from "AddEmployee" action to "Preview" action without using TempData/ Session?
public ActionResult AddEmployee(EmployeeViewModel employeeViewModel)
{
TempData["employee"] = employeeViewModel;
return this.RedirectToAction("Preview");
}
public ActionResult Preview()
{
var model = TempData["employee"] as EmployeeViewModel;
return this.View("Preview", employeeViewModel);
}