示例
@Html.DropDownList("ComeFrom",
new List<SelectListItem>()
{
new SelectListItem() { Value = "所有", Text = "所有" },
new SelectListItem() { Value = "城投", Text = "城投" },
new SelectListItem() { Value = "单位", Text = "单位" }
},
@ViewData["ComeFrom"] as string,
new { @class = "l-text-field", @style = "width:180px" }
)
第一个名字,第二个数据源,第三个默认值,第四个HTMLattribute
标签:Text,Value,ComeFrom,参数,new,SelectListItem,DropDownList From: https://www.cnblogs.com/Biyuanguang/p/17071686.html