I wanted to know if it is possible to send direct from the controller, for example the current date and time of the system without using javascript. Ex:
<div class="form-group">
@Html.LabelFor(model => model.DataAvaliacao, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.DataAvaliacao, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.DataAvaliacao, "", new { @class = "text-danger" })
</div>
</div>
// GET: Avaliacao
public ActionResult Create()
{
DateTime data = DateTime.Now;//Essa data ao carregar a tela aparece para o usuário
return View();
}
Type as if it were the Viewbag
and then the time the screen loads, the date and time appear