错误的List传值,然并卵

BookContext db=new BookContext();

 public ActionResult Index()
        {
            List<Students> students = new List<Students>()
        {
            new Students{Id=1,Name="Ava"},
            new Students{Id=2,Name="z"},
            new Students{Id=3,Name="c"},
        };
            ViewBag.students = students;
            //ViewData.Model = students;
            return View(students);
        }

posted on 2016-01-04 21:57  the_best  阅读(131)  评论(0编辑  收藏  举报