0
我的模型文件夹中有两个模型叫做模型,我试图从模型中拉出数据在视图中显示它,我知道只有一个模型语句可以应用于视图。所以我创建了一个ViewModels,它包含了我想在视图中引用的属性。现在,当我运行的应用程序即时得到一个编译错误,它说:在一个视图中的两个模型asp.net mvc 4不工作
“编译器错误信息:CS0246:类型或命名空间名称‘模式’找不到(是否缺少using指令或程序集鉴于参考?)”
视图模型代码
public class MainModelscs <T> where T :class
{
public StoreAudit StoreAudit { get; set; }
public StoreQuestions StoreQuestions { get; set; }
public IPagedList<T> IndexList { get; set; }
}
模特属性
@model PopMarketing.ViewModel.MainModelscs<Models>
谢谢我试过你的解决方案,但它仍然不工作 – cazlouise
什么是错误信息? – fireydude