I am creating multiple views. Each view is having next,previous buttons. When user click next button we will pass the previous pages data.
When user clicks Previous data we have to show the data which is previously entered.
For this approach I have used Sessions to be persist the data across the all views.
But session are very dangerous and heave objects.
Can anyone please suggest me an another approach.
public ActionResult CustomerInfo(Registration registration)
{
if (ModelState.IsValid)
{
Session[SessionKeys.RegistrationStep1] = registration;
return RedirectToAction("EquipmentOwnerInfo");
}
return View(registration);
}
public ActionResult CustomerInfo(string from)
{
if (Session[SessionKeys.RegistrationStep1] != null)
{
registration = (Registration)Session[SessionKeys.RegistrationStep1];
}
return View(registration);
}