I am trying to build a registration form. I have a model for all of the data for the users, but the problem is i want the form to be i “steps”. So you fill out two parameters, and goes to the next step.
Now i’ve tried the approach to return the model in every step, and putting the earlier filled in data in hidden fields in the form, but that causes the non filled out forms to “trigger” the validation since i returned a model where only the previously filled out data is available. That is not very nice, so what would be the best approach of doing this?
As a quick solution for a small application, you could always store the model in the Session (or TempData) object:
For larger applications (and depending on your business rules) I’d recommend persisting the values to a data store on the completion of each form.
Note, there are trade-offs with either approach that you will need to weigh depending on your application.