I\'m trying to add a class to an input.
This is not working:
@Html.EditorFor(x => x.Created, new { @class = \"date\" })
You can't set class for the generic EditorFor. If you know the editor that you want, you can use it straight away, there you can set the class. You don't need to build any custom templates.
@Html.TextBoxFor(x => x.Created, new { @class = "date" })