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
Release: 2023-09-06 18:33:03
forward
1091 people have browsed it

在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" })
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template