错误的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);
}