EditorFor do not accept Readonly or Disabled

58 views Asked by At

Is there a way to setup a EditorFor in ReadOnly or Disabled?

I've tried many different ways no success.

This is the last one:

<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

There are 0 answers