【发布时间】:2014-03-15 20:54:44
【问题描述】:
我的主屏幕的视图模型为DashboardViewModel。它具有带有自己的 ViewModel 的 PartialView,例如 CustomerSearchViewModel 和 SelectProductViewModel。
所有三个 ViewModel 都是独立的。
当我运行应用程序时出现此错误:
传入字典的模型项是类型 'Invoice.Web.ViewModels.DashboardViewModel',但是这本字典 需要类型的模型项目 'Invoice.Web.ViewModels.SearchCustomerWindowVM'。
我想知道我应该怎么做才能解决这个问题。
按照计划,主屏幕最终会将许多 PartialView 与它们自己的视图模型集成在一起。我是否在DashboardViewModel 中声明了部分视图模型?还是我只是有一个大的DashboardViewModel 用于所有部分视图?
【问题讨论】:
标签: asp.net asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-mvc-2