ASP.NET MVC 2 当view要显示多个表的数据时 而且view中要使用多个foreach来遍历对应的数据表,怎么解决?

ASP.NET MVC 2 中:
当view要显示多个表的数据时 而且view中要使用多个foreach来遍历对应的数据表,怎么解决?

1. Model类:public class 所有表model类 {
public List<单表1> 表名{ get; set; } public List<单表2> 表名2{ get; set; } }2. Controller: List<所有表model类> list = new List<所有表model类>(); return view(list)3.view页:foreach (var item in Model.单表1) {}后面就不用说了。
温馨提示:答案为网友推荐,仅供参考