I have view model which has another child model to render the partial view (below).
public class ExamResultsFormViewModel
{
public PreliminaryInformationView
You need to create an editor template for PreliminaryInformationViewModel
to replace the partial view, then call with Html.EditorFor( m => m.PreliminaryInformation )
. Reference this solution. Creating the template should be as simple as moving your partial view to the Views/Shared/EditorTemplates directory. Html.EditorFor(...)
will automatically use this template based on the type you're passing in as the model (in this case, PreliminaryInformationViewModel
)