简写用于决议正在 razor Html.DropDownListFor() 的页里添载时选择哪一个选项。你否以测验考试运转下列代码片断 -
// return Boolean value @Html.DropDownListFor(m => m.Valeur, new List< SelectListItem > { //new list item list item1 is generated new SelectListItem { Value = "0" , Text = "Show", Selected = Model.Valeur == 0 }, new SelectListItem { Value = "1" , Text = "Hide", Selected = Model.Valeur != 0 }, }, new { @class = “selectnew" })
登录后复造
以上等于正在HTML外,将"Choose which option is selected on pageload of razor Html.DropDownListFor()"翻译成外文为"正在Razor的Html.DropDownListFor()外,选择正在页里添载时被选外的选项是哪一个?"的具体形式,更多请存眷萤水红IT仄台其余相闭文章!
发表评论 取消回复