DisplayFormatAttribute not working
问题 I am using MVC3 with Razor and EntityFramework. To handle event scheduling I have a StartDate, StartTime, EndDate, EndTime using jquery datepicker and timepicker. I am trying to use the DisplayFormatAttribute in my ViewModel but the Textbox keeps showing the entire DateTime string. In my viewmodel I have the following properties: [DisplayFormatAttribute(DataFormatString = "{0:mm/dd/yyyy}")] public DateTime StartDate { get; set; } [DisplayFormatAttribute(DataFormatString = "{0:h:mm tt}")]