Home >Web Front-end >HTML Tutorial >In HTML, 'Choose which option is selected on pageload of razor Html.DropDownListFor()' is translated into Chinese as 'In Html.DropDownListFor() of Razor, choose which option is selected when the page is loaded?'

In HTML, 'Choose which option is selected on pageload of razor Html.DropDownListFor()' is translated into Chinese as 'In Html.DropDownListFor() of Razor, choose which option is selected when the page is loaded?'

WBOY
WBOYforward
2023-09-06 18:33:031123browse

在HTML中,将"Choose which option is selected on pageload of razor Html.DropDownListFor()"翻译成中文为"在Razor的Html.DropDownListFor()中,选择在页面加载时被选中的选项是哪个?"

The abbreviation is used to determine which option is selected on page load in razor Html.DropDownListFor(). You can try running the following code snippet -

// 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 = &ldquo;selectnew" })

The above is the detailed content of In HTML, 'Choose which option is selected on pageload of razor Html.DropDownListFor()' is translated into Chinese as 'In Html.DropDownListFor() of Razor, choose which option is selected when the page is loaded?'. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete