you will want to design this a little differently. The main view will have a model - allows you to call it MainModel, and a partial view can have a model - we will call itPartialModel
public class PartialModel
{
}
public class MainViewModel
{
public PartialModel Partial { get; set; }
public MainViewModel()
{
Partial = new PartialModel();
}
}
then your main view will be
@model MainViewModel
then in the middle of the main view you have something like
@{ Html.RenderPartial("myPartialView", Model.Partial); }
Note the braces around the Html.RenderPartial. They are necessary because the RenderPartial return is invalid.
, , ,