var CityList = WebBLL.Tbl_ClassManager.GetDataTableByPage(1000, 1, "parentid=3", "ordernum asc"); List<SelectListItem> item1 = new List<SelectListItem>(); //CityList = CityList. var lstID = (from d in CityList.AsEnumerable() select new SelectListItem() { Text = d["ClassName"].ToString(), Value = d["ID"].ToString(), }); item1.AddRange(lstID);
@Html.DropDownList("CityOrigin", null, new { @class = "input-xlarge form-control" })
原文:https://www.cnblogs.com/fger/p/10910452.html