MVC3 EditorFor readOnly

前端 未结 12 1688
谎友^
谎友^ 2020-12-05 09:04

I want to make readOnly with EditorFor in edit page.

I tried to put readonly and disabled as:

@Html.Editor
12条回答
  •  星月不相逢
    2020-12-05 10:06

    Try using:

    @Html.DisplayFor(model => model.userName) 
    @Html.HiddenFor(model => model.userName)

提交回复
热议问题