0

I have an ajaxToolkit:CalendarExtender who keeps the selected date on a textbox. I want to validate that the selected date is 15 days after current date.

I set the min value, but I get the error when the page id loading:

The MaximumValue cannot be less than the MinimumValue 4 Jun 2019 of RangeValidator1.

The max value doesn't matter.

RangeValidator1.MinimumValue = System.DateTime.Now.AddDays(15).ToShortDateString();

To load the page and the textbox to allow dates after the current date with 15 days.

jonaChaz
  • 301
  • 3
  • 17
piglet
  • 7
  • 8

1 Answers1

0

I think you need to set the maximum value:

RangeValidator1.MaximumValue = System.DateTime.MaxValue.ToShortDateString();
jonaChaz
  • 301
  • 3
  • 17