I have an editor template as following but class, maxlength and size attributes are not getting to the source.
@using System.Globalization
@model DateTime?
@Html.TextBox("", (Model != null && Model.HasValue && !Model.Value.ToString(CultureInfo.InvariantCulture).Contains("1900") && !Model.Value.ToString(CultureInfo.InvariantCulture).Contains("0001") ? Model.Value.ToString("MM/dd/yyyy") : string.Empty), new { @class = "datePicker", maxlength = "12", size = "12" })
I have changed it to following and it is still the same
@Html.EditorFor(x => x.Criteria.FromDate, new { @class = "datePicker", maxlength = "12", size = "12" })
Source
<input class="text-box single-line" id="Criteria_FromDate" name="Criteria.FromDate" type="text" value="" />
How can i fix this?