EditorFor不接受Readonly或Disabled

时间:2015-06-11 18:47:48

标签: asp.net-mvc view readonly editorfor

有没有办法在ReadOnly或Disabled中设置EditorFor

我尝试了许多不同的方法,但没有成功。

这是最后一个:

<div class="form-group">
    @Html.LabelFor(Function(model) model.Operador, htmlAttributes:=New With {.class = "control-label col-md-3"})
    <div class="col-md-9">
        @Html.EditorFor(Function(model) model.Operador, New With {.disabled = "disabled", .readonly = "readonly", .htmlAttributes = New With {.class = "form-control"}})
        @Html.ValidationMessageFor(Function(model) model.Operador, "", New With {.class = "text-danger"})
    </div>
</div>

0 个答案:

没有答案