c# mvc 多个@model 如何定义
聪明的傻瓜 2012-09-19 06:18:34 @model ICollection<Products>
@model Products
如果我页面使用对象较多,model 重复了怎么办
有循环的列表,也有单纯的对象展示
@foreach (Products product in Model)
{
}
@Html.Raw(Model.Content)
Model对象冲突了。如果都是列表,那么数据一样了,如果是不一样的,报下面的异常
The model item passed into the dictionary is of type 'Products', but this dictionary requires a model item of type 'System.Collections.Generic.ICollection`1[Products]'.
请问多@model 对象如何定义,谢谢