解决方法
最好不要在视图中创建SelectList.您应该在控制器中创建它,并使用ViewData传递它.
例:
var list = new SelectList(new [] { new { ID = "1",Name = "name1" },new { ID = "2",Name = "name2" },new { ID = "3",Name = "name3" },},"ID","Name",1); ViewData["list"]=list; return View();
你传递给constrㄧctor ctor::::::::the the the.the…………..
在视图中:
<%=Html.DropDownList("list",ViewData["list"] as SelectList) %>