asp.net MVC Views-----Controller传递数据方法

1.ViewData:C传递数据到V中:ViewData["studentList"]=studentList;

      V接收C传来的数据:var stu=(Student)ViewData["studentList"];

2.ViewBag:C---------->V:ViewBag._product=p;

           接收:var p=(product)ViewBag._product;

3.model:C--------------V:return View(p);

           接收:@model student

              @using 项目.文件.类名

              @model.Guid,

              @model.Name,

posted @ 2017-06-08 23:27  倔小强  阅读(148)  评论(0编辑  收藏  举报