0

My model is

[Required]
[DataType(DataType.Date)]
[Display(Name = "Effective Date")]
public DateTime EFFECTIVEDATE;

I am using Razor in View

@Html.EditorFor(model => model.EFFECTIVEDATE)

How can I enforce MinDate (like from Jquery Datepicker) to disable previous dates in dropdown calendar using Annotations?

  • You can create your own Attribute - for example: http://stackoverflow.com/questions/8844747/restrict-datetime-value-with-data-annotations – James P Feb 07 '17 at 01:43
  • @JamesP Thank you.. I was just curious if visual studio supported any annotation to restrict range – Annas Rafique Feb 13 '17 at 05:59

0 Answers0