Skip to content Skip to sidebar Skip to footer

TextBoxFor Show Date Without Time

I want to show date in text field in format MM/dd/yy. I described model class as: public class VacancyFormViewModel { public int? ID { get; set; } [DisplayFormat(ApplyForma

Solution 1:

You can specify date format in TextBoxFor helper like this:

@Html.TextBoxFor(m => m.SurgeryDate, "{0:MM/dd/yy}",  new { @class = "form-control" })

Post a Comment for "TextBoxFor Show Date Without Time"