0
I wanted to know if it is possible to send directly 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();
}
Like it was the Viewbag
and then at the time the screen load, appear the date and time
With
ViewBag
!!!– novic