I need to maintain my ViewModel data when doing a Redirect to Action. I understand I can do this using tempdata, but I’m not sure what that looks like. Here is my re-direct:
if(StateList == "MN" && PorR == "Purchase")
{
TempData["calculationViewModel"] = calculationViewModel;
return RedirectToAction("MNPurchase");
}
Once I re-direct to the action MNPurchase, how do I create a ViewModel out of the TempData?
You should cast it to your model Type. Otherwise it will be object.