I plan to create a multi-stage form with asp.net mvc 2. So, my web application will have 5 pages corresponding to 5 steps. At each step, there are two submit buttons, the previous and the next. Input data for each step will be saved for later viewing. For example, we already entered the data for step s 1,2,3,4, and now we are at step 5. When I press the “previous” 2 times, step 3 should be displayed with the previously entered data. Similarly, when I click "next", the input should also be stored in step 4 (since we are now in step 3). The model used for each step can be very different.
I am looking for a solution to save data for each step. I think of session and tempdata, both of them have disadvantages that I have to consider in order to use
Session
- The default session is a cookie session, so the session will not work if the web browser does not support cookies. I am also concerned here, when IE does not support cookies, the session variable will be lost only if the host name is used to access the web application . The session works fine in IE with an IP address .
- Cookies less session: unsafe, have many restrictions and have a problem with the message (http://stackoverflow.com/questions/3972433/mvc2-cookieless-session-issue-using-post or http://forums.asp.net/p /1517391/3634908.aspx )
- Tempdata: tempdata is simply saved for a single request.
I really appreciate your advice!
Many thanks!
source
share