I have a model like:
public class MyModel { public string Name {get; set;} public DateTime StartDate {get; set;} }
Then, in my "Razor" view, I have the following:
@Html.EditorFor(x => x.StartDate, new { @class = "input datepicker" })
The resulting HTML is as follows:
<input class="text-box single-line" data-val="true" data-val-required="The StartDate field is required." id="StartDate" name="StartDate" type="text" value="01/01/0001 00:00:00">
It seems like I completely ignore the definition of @class (as well as adding validation material of my own)
Is there any way to render with my specified class?
source share