2
I have a Datahora field and wanted to use it separately, that is, a single field in the database called Datahora of the datetime type, and manipulate this field with two editorfor where I save the date of one editorfor and the time of another editorfor in the same field of the database:
View:
<div class="form-group">
@Html.LabelFor(model => model.DataHora, "Liberar encomenda as", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.DataHora, new { htmlAttributes = new { @class = "form-control" } }) Horas
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.DataHora, "Liberar encomenda dia", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.DataHora, new { htmlAttributes = new { @class = "form-control" } })
</div>
</div>
Class:
public DateTime DataHora { get; set; }
Are you using a Persistence layer? If yes could put the class in your question, there is a way that you do not need to do much if it is that, depending even if it is without ORM also gives! Tell me how you save this information, post also your
controller
?– novic