Описание тега selectlistitem
Refers to the SelectListItem class used to generate html <option> elements in a view associated with the ASP.NET MVC framework
</option>
In ASP.NET MVC views, the DropDownListFor method is typically used to create a HTML <select>
tag and its <option>
elements. The SelectListItem class provides a convenient means of generating a collection in the controller to represent the options to generate in the <select>
tag.
The Value
property of SelectListItem
sets the value
attribute of the <option>
tag and the Text
property sets its inner text. Additional properties of SelectListItem
can be used for selecting the option, disabling the option and grouping the option in <optgroup>
elements.