DropDownList参数

 

示例

@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

posted @ 2023-01-29 08:50  Biyuanguang  阅读(32)  评论(0编辑  收藏  举报