I have the below view model that has both school and Address objects like
namespace myapplication.ViewModels
{
public class SchoolViewModel
{
public Address schoolAddress { get; set; }
public School school { get; set; }
}
}
and I have student,teacher and other objects that has address with addressId field, when I create the school object, since school object has addressID, I have to create both the address object and school object by making partial view for address object,so that I will not repeat the address fields for all objects that require address. so the school create view will have SchoolViewModel,to accept both object fields.so the Create View is strongly typed view of SchoolViewModel object. And for address create I make strongly typed of partial view with Model.schoolAddress object. The problem is Model.schoolAddress is null. like <% Html.RenderPartial("addressPartilaView", Model.schoolAddress);%> but when the address partial view is strongly typed of SchoolViewModel object I can get the value of schoolAddress. please ,please would you give me some idea about this, or how can I proceed with other solutions?