I have :
@Html.EditorFor(model => model.name)
This display my user name but I want to override this name. So I tried this :
@Html.EditorFor(model => model.Password, new { value = "othertext"} )
But this doesn’t work, I always have my user name.
Thanks for your help !
The “additional view data” parameter on EditorFor sets up new view data to be used by your editor template(s). It does not make “extra objects” to be rendered as you seem to be using it here.
And as I understand you trying to set
htmlAttributes: