I have a Partial view that I would like to use on 2 different Stronly-Typed views. The data being passed is just a simple ID integer, but when I try to render the data on View #2 I get an
The model item passed into the dictionary is of type
CMESurvey.ViewModels.SurveyParticipantViewModel, but this dictionary requires a model item of typeCMESurvey.Models.SurveyProgramModel.
Here is the partial view code that errors:
@Html.Partial("SurveyProgramSubNav", new {ProgramId = Model.ProgramId})
This code is in a differently strong typed from my Partial View Strong Type:
@model CMESurvey.Models.SurveyProgramModel
for the partial view, and:
@model CMESurvey.ViewModels.SurveyParticipantViewModel
For the view that I’m having trouble with. Any help is appreciated.
I think you want:
specify strong type of the model instead of automatic type.