Rookie question. I have a parameter being passed to a create view. I need to set a field name with a default value. @Html.EditorFor(model => model.Id) I need to set this in
For me I need to set current date and time as default value this solved my issue in View add this code :
@Html.LabelFor(model => model.order_date, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.order_date, new { htmlAttributes = new { @class = "form-control",@Value= DateTime.Now } })
@Html.ValidationMessageFor(model => model.order_date, "", new { @class = "text-danger" })