Nov 18, 2012 at 5:24 PM
Edited Nov 18, 2012 at 5:25 PM
I am trying to retrieve data which is saved on one screen (whether hitting "Back" or going to a summary (confirm) screen).
I tried slapping an "int id" on the Confirm ActionResult and making the variable "_askUsService.GetAskUs(id)". This is throwing an expected error ( null entry for parameter 'id' of non-nullable type). So I am trying to research
how to get some type of ID on the Details ActionResult in order to persist the data going forward into the Confirm ActionResult. I may just try the DateTime I saved in the Part/PartRecord since it's fairly unique.
The behavior is as follows:
1) User enters information on Details screen. If there are no validation errors, the data gets saved after the user hits Next. The Next button triggers a Redirect to the Confirm ActionResult.
1a) In the backend, the data is saved and I can view a List in the Admin Dashboard (as well as a Details view of each individual item). My thinking is probably incorrect in this: there is an ID being placed in the database. I just thought that the
ID would be something I could use (rather than the DateTimeCreated entity I created) to retrieve it on the front end.
2) When it goes to the Confirm screen, I am trying to re-display what the user input to confirm it. There is a back button so the user can go back and edit the inputs. However, I cannot figure out how to pass the saved data to the Confirm screen, and
therefore it's not showing.
3) If the user hits the Back button, it should show the Details form again with the data the user entered populating the inputs for editing. This is again where I may be wrong in my thinking: should I create a new DetailsEdit ActionResult to populate
the inputs. The behavior now is that the form re-displays empty ready for input (if I input again I am just creating another record).
Thanks for the help.