摘要: 视图数据可以通过ViewBag属性访问,它主要是为了从Controller到view进行传值用的,类似有所使用的ViewData[] 字典类。对于ViewBag是如此的强大,意味着你能动态的set/get 值,增加任何数量的的额外字段而不需要强类型的检测。如:Controller 1 public 2 ActionResult Index() 3 { 4 List<string> 5 colors = new 6 List<string>(); 7 colors.Add("red"); 8 colors.Add("green"); 阅读全文
posted @ 2013-03-07 16:58 net515 阅读(1150) 评论(0) 推荐(0) 编辑