using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Test.Models;
namespace Test.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
var model = new DropDownListData();
model.DropDownListItems.Add(new SelectListItem { Text = "Sun", Value = "1" });
return View(model);
}
}
}
说
System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem>
不包含“添加”的定义,并且找不到接受第一个类型参数的扩展方法“添加” System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem>
(您是否缺少 using 指令或程序集引用?)
我缺少什么参考?