I have property Name which I want to be readonly. So inside viewmodel I decorated this property with attribute readonly like
[ReadOnly(true)]
public string Name { get; set; }
and inside Edit view I have
@Html.EditorFor(model => model.Name)
@Html.ValidationMessageFor(model => model.Name)
and I'm still able to edit make changes inside textbox.
Should I use some css class to disable this textbox on the view side or this should be enough (if that is the case why this solutions does'nt work).