Home>Article>Web Front-end> 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
WBOY forward
2023-09-06 18:33:03 1014browse

在HTML中,将

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 = “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