I have a _Layout.cshtml in mvc4 web application, in this master view i am calling a partial view for menu which is strongly type , now I have created a new strongly typed partial view for service menu link I have wrote the code to get data from database , But now when i click on the service menu link i am getting the below error message
"
"
The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[BusinessApplicationTemplate.Models.Service]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[BusinessApplicationTemplate.Models.slider]'.
why it is so
Midhun TpRank #388 · 6.5K reputationPosted Sep 11, 2016, 6:27 PM EDT
Mark TaborRank #914 · 2.3K reputationPosted Sep 11, 2016, 8:39 PM EDT
The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[BusinessApplicationTemplate.Models.slider]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[BusinessApplicationTemplate.Models.Service]'.
and when i reference the service model then it saysThe model item passed into the dictionary is of type 'System.Collections.Generic.List`1[BusinessApplicationTemplate.Models.service]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[BusinessApplicationTemplate.Models.slider]'.
}
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Sep 11, 2016, 10:21 PM EDT
Mark TaborRank #914 · 2.3K reputationPosted Sep 11, 2016, 10:30 PM EDT
Bikesh Srivastava
it is not that issue i am already using IEnumerableAnswer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts