I would like to know how I can pass values from one action to another action without redirecting to that controller.
For example, I want to pass values from my "Index" action to my "reservation_step_2" action without having to redirect to that page but instead to my "reservation_step_1" page.
[HttpPost]
public ActionResult Index(string locationId, string dt1, string dt2, string PickUpTime, string DropOffTime)
{
string loc = locationId;
string PUT = PickUpTime;
string DOT = DropOffTime;
DateTime d_in = DateTime.ParseExact(dt2.Trim(), "dd/M/yyyy", System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat);
DateTime d_out = DateTime.ParseExact(dt1.Trim(), "dd/M/yyyy", System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat);
return RedirectToAction("reservation_step_1", "Home", new { d_out = d_out, d_in = d_in, loc = loc, PU_time = PUT, DO_time = DOT});
}
I would like to pass d_out, d_in, PU_time and DO_time to "reservation_step_2" but pass loc to "reservation_step_1" and redirect to "reservation_step_1"
How can I go about doing this?