I try to add id to textbox but get error. I should use Html.EditorFor()
statement.Please advice.
My code:
@Html.EditorFor(model => model.Historicals.HistoricalName, new { htmlAttributes = new { @class = "form-control" } }, new { id = "Historical_place_name" })
I believe you should add the id property to the html attributes.
@Html.EditorFor(m => m.Historicals.HistoricalName,
new { htmlAttributes = new { @class = "form-control", id = "Historical_place_name" } });