In my Asp.net MVC project, I have a scenerio where in,
- User have a big form named "Form A" to fill up.
- On filling half of the Form A,user is redirected to Form B to fill information.
- On completing Form B, user is redirected back to Form A and at this time Form A should be pre-filled by the information user filled before going to Form B.
How and where to hold the half filled Form A information when user is filling Form B and how to refill Form A with this previously filled information?
One approach would be to
save the incomplete object/form
that you are building (you may consider forms A,B,C, etc... as parts of a wizard) to the database and just pass theid to the next step
of the wizard. This also means you need to make some of the database fields nullable, but it has BIG advantage that you can also save the id in a cookie and allow the user to come back to the wizard at some later stage. This approach does not require any javascript or session state.For a sample code samples on asp.net wizards you make look the following posts:
1) Create a Wizard in ASP.NET MVC 3
2) Creating a simple form wizard in ASP.NET MVC 4
3) Creating Wizard in ASP.NET MVC Part 2
is this helpful
Passing Data in an ASP.NET MVC Application
You can store values in ViewData or in Session to pass values while navigating from
Page A to Page B