I want to make readOnly with EditorFor in edit page.
I tried to put readonly and disabled as:
@Html.Editor
This code is supported in MVC4 onwards
@Html.EditorFor(model => model.userName, new { htmlAttributes = new { @class = "form-control", disabled = "disabled", @readonly = "readonly" } })