【发布时间】:2016-03-30 15:10:00
【问题描述】:
有一个名为 HomeVM 的 ViewModel 有 7 个模型。我添加了一个名为 NewsVM 的新 ViewModel,并在 HomeVM 中剪切了 3 个模型并粘贴到 NewsVM 中。
我将所有内容都更改为新的 ViewModel,但出现此错误:
The model item passed into the dictionary is of type 'NP1.ViewModels.NewsVM', but this dictionary requires a model item of type 'NP1.ViewModels.HomeVM'.
感谢您的帮助。
【问题讨论】:
标签: asp.net-mvc razor model asp.net-mvc-5 viewmodel