0

I'm doing a form that has 3 steps. The first step has a next button. The second step has a button back and next button. Finally the third step, has a button back and submit (to do something).

I'm thinking that a good way to move between steps would be handling objects. With a single controller with three methods for the three steps.

I think a good way to move between steps (saving data) would be handling objects in a parent object (that encapsulates the objects).

My logic is:

First step: I have no saved object. When I click on the next button, I save the data from step one in an "object A".

Second step: I have the "object A" saved (with data from the first step). If I click the Back button I go back to step one (obviously), but I lose the "object A". If I click on the next button I'm going to step three with the "object A" + "object B" (with data from the second step).

Third step: I have the "object A" and "object B" saved. If I click the back button I go back to step two, but I lose the "object B". If I click on the submit button I have the objects A + B + C saved.

So, I want encapsulate objects in a parent object.

Is important to say that in all steps I get information from different tables of the database.

Someone have a good example with this logic? Thanks.

Mirko
  • 21
  • 1
  • 3
  • Here's the solution http://stackoverflow.com/questions/6402628/multi-step-registration-process-issues-in-asp-net-mvc-splitted-viewmodels-sing – Mirko May 13 '15 at 21:10
  • [Another alternative](http://stackoverflow.com/questions/29854603/post-view-model-instance-back-to-several-action-methods/29859454#29859454) to do everything on one form and avoid trying to mimic the old WebForms ViewState –  May 13 '15 at 22:31

0 Answers0