在表单中选择字段

时间:2015-05-13 00:47:21

标签: asp.net-mvc razor

我正在使用这样的表单,如何将textboxfor更改为选择,因为我无法在@Html

中找到任何选项
@using (Html.BeginForm("LeggTilUtdannelse", "Utdannelse", FormMethod.Post, new { @class = "form-horizontal", id = "legg-til-form" }))
{
    @Html.AntiForgeryToken()
    <div class="form-group">
        @Html.LabelFor(m => m.Til, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.TextBoxFor(m => m.Til, new { @class = "form-control", autocomplete = "off" })
        </div>
    </div>
}

1 个答案:

答案 0 :(得分:0)

我认为您正在寻找@ Html.DropDownList或@ Html.DropDownListFor。

相关问题