3
Dear friends, I need to present only the date in a Textboxfor field. I use this HTML Control because I use a Javascript mask that formats the field value at the time of the date input.
@Html.TextBoxFor(model => model.DtCadastro, htmlAttributes: new { @id = "DtCadastro", @name = "DtCadastro", @onkeyup = "javascript:Formatar(this.value, this.form.name, this.name, 'data');", @onchange = "javascript:Formatar(this.value, this.form.name, this.name, 'data');" })
[Display(Name = "Data do Cadastro:")]
[Required(ErrorMessage = "Informe a data do cadastro")]
[DataType(DataType.Date)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:d}")]
public Nullable<System.DateTime> DtCadastro { get; set; }
It worked @Cigano .. Even with the mask it worked .. Thanks
– Gleison França