Asp.net mvc 动态设置选择列表中的选定值
我有一个选择列表,我正在使用asp标记帮助程序创建它。 我想将默认值设置为数据库中当前设置的值Asp.net mvc 动态设置选择列表中的选定值,asp.net-mvc,razor,drop-down-menu,asp.net-core-tag-helpers,Asp.net Mvc,Razor,Drop Down Menu,Asp.net Core Tag Helpers,我有一个选择列表,我正在使用asp标记帮助程序创建它。 我想将默认值设置为数据库中当前设置的值 <select asp-for="QualificationTypeId" id="QualificationTypeId" asp-items="@Model.QualificationTypes" class="ProgInfoCellWidth"> </select> //@Model.QualificationTyp
<select asp-for="QualificationTypeId" id="QualificationTypeId"
asp-items="@Model.QualificationTypes" class="ProgInfoCellWidth">
</select>
//@Model.QualificationType
//this is the value I want to set as the default selected
//@Model.QualificationType
//这是我要设置为默认选定值的值
您可以将默认选定值设置为限定类型ID