I am having trouble dealing with user registration in ASP.NET MVC3 Model Binding.
Basically, I have a ViewModel that consists of UserDetails (name, identification, dob and other things) and a reusable ViewModel, Address.
So, UserDetails class will also carry an Address class.
Then, I created a partial view with model binding to Address ViewModel so that this too can be reusable.
In view, this is what I did: @Html.Partial(“CommonAddress”)
However, upon creation of user, I was unable to retrieve Address at all as it is still null. Is there a way to resolve this issue?
Pass your address model to the partial just like
If you do not have a model yet, pass a default/empty model from your Controller Edit action (the one that handles the GET HTTP request) to the view.