public async Task <IActionResult> Index(Guid id) { var paymentOptionsVm = await _buildPaymentOptionsVmService.Build( LoggedInUser, ApplicationSessionState, id, GetCaseflowUserId()); if (TempData.ContainsKey("GTMEvents")) { paymentOptionsVm.GtmEvents = JsonConvert.DeserializeObject <List <GtmEvent> >(TempData["GTMEvents"].ToString()); } _gtmService.RaisePaymentEvent_PageVisited(paymentOptionsVm, LoggedInUserId, "Regular Account"); // Save initial state in 'State' field, so that it can be reconstructed on postback // Field values lost due to a lack of hidden fields etc. will be retained this way paymentOptionsVm.InitialState = SerialiseModel(paymentOptionsVm); return(View(paymentOptionsVm)); }