I would like to autofocus on an editorfor in my application, but I can\'t seem to do that. I have successfully used autofocus on a textbox, but I would like to use an editor
You put the autofocus attribute in the wrong spot.
@Html.EditorFor(model => model.Description,
new { htmlAttributes = new { @class = "form-control" }, autofocus = "" })
Try this instead:
@Html.EditorFor(model => model.Description,
new { htmlAttributes = new { @class = "form-control", autofocus = "" } })