MVC DropDownListFor视图文本更改中的基本True False

时间:2017-01-22 23:52:48

标签: asp.net-mvc asp.net-mvc-4 asp.net-mvc-3 drop-down-menu

<div class="form-group">
    @Html.LabelFor(model => model.Supervisior, new { @class = "" })
    @Html.EditorFor(model => model.Supervisior, new { @class = "", required = "required", form_id="form1" })
    @Html.ValidationMessageFor(model => model.Supervisior)
</div>

属性Supervisor是一个可以为空的bool

public Nullable<bool> Supervisior { get; set; }

我希望EditorFor()生成的下拉列表的显示名称为true,显示&#34;确认&#34;以及false,显示&#34 ;拒绝&#34;

0 个答案:

没有答案