I need to capture three different types of information from a new user who is registering for the first time in an MVC 3 app (using EF code first). Ideally on the one page (which will have three tabs)
- User info
- Extended user info
- Benefits chosen by user
The register method of the account controller should populate the user table when it fires. I need some advice on how best to capture the other data. DO I create a UserDetails model for the additional data? If so is it possible to update this from the same page? (which would be the Account/Register page. Do I need to do something in the account controller or will the relationship between the models be enough?
Are there any good examples about that would explain this? I tried the MVC Contoso University one but couldn’t see if I could do this.
Any advice very welcome 🙂
Thanks
You can create a view model that combines all the fields you need from the other models, and strongly type your view to that. Once the user submits the info back to the controller, you’ll process each property appropriately.
and then