Try
<asp:CompareValidator ID="CompareValidatorBookingDeadline" runat="server"
ControlToCompare="TextBoxSeminarDate"
ControlToValidate="TextBoxBookingDeadline" Display="Dynamic"
ErrorMessage="Please check the seminar date and select appropriate date for booking deadline"
Operator="LessThanEqual"
Type="Date"
ValueToCompare="<%= TextBoxSeminarDate.Text.ToShortString() %>">*</asp:CompareValidator>
The above code enable you to Compare two input dates to avoid invalid dates. In this example I have created two textboxes and namded as
"TextBoxSeminarDate"
and
"TextBoxBookingDeadline"
. Booking deadline date must be before date to the Seminar date. Therefore I used Operator as
"LesThanEqual"
.
Reference Link:-
Date Compare Validator Control ASP.NET[
^]