首页 > 其他分享 >DropDownList参数

DropDownList参数

时间:2023-01-29 08:55:32浏览次数:42  
标签:Text Value ComeFrom 参数 new SelectListItem 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

标签:Text,Value,ComeFrom,参数,new,SelectListItem,DropDownList
From: https://www.cnblogs.com/Biyuanguang/p/17071686.html

相关文章