I have an _Address partial view. This partial view contains all of the address fields that match the Address Model. At the top of this view I set the model like this:
@model Data.Address
In my CustomerInfo view I try the following to render the Address fields as part of my form:
@Html.Partial("~/Views/Shared/Partial/_Address.cshtml")
The error I am getting is:
The model item passed into the dictionary is of type 'Data.Customer', but this dictionary requires a model item of type 'Data.Address'.
I am assuming I am getting this error because the model declared in my CustomerInfo view is of type Data.Customer and it is automatically trying to pass it to my _Address view which has a model of type Data.Address in it.
What is the proper way to make this flow properly? I noticed there is also an @Html.RenderPartial("ViewName", model) helper but have no idea how to pass it Data.Address since the primary model in my CustomerInfo view is Data.Customer.