3
How could you put Default value on a Html.EditorFor
?
Understanding my code,
I have a field that’s a filter when I click on EditorFor
open the calendar, I’d like the datetime.now
but only visual without performing the filter.
Because if I put it in the model (get;set) I can show more already by performing the filter.
Code used.
@Html.EditorFor(model => model.ModelPaging.Filter.dataInicioIndicadores)
I’ve tried it like this.
@Html.EditorFor(model => model.ModelPaging.Filter.dataInicioIndicadores, new { htmlAttributes = new { @Value = ViewBag.DataAtual} })
@Html.EditorFor(model => model.ModelPaging.Filter.dataInicioIndicadores, new { @Value = ViewBag.DataAtual})
Does anyone know a way to pass a default value?
I don’t quite understand it, it’s something how that that you want?
– Randrade