i have 2 textboxes that i am filling with StartDate, and Endate.
i want to use the compareValidator to make sure that the StartDate is less that the EndDate. i used this:
<asp:CompareValidator ID="Comp" ControlToValidate="txtStartDate" ControlToCompare="txtEndDate" Operator="LessThan" Type="Date" runat="server" Display="dynamic" Text="Failed!" />
the validator is always giving me Failed no matter what the dates are. if startdate>endate or vise versa, Failed appears.
i am using (MM/dd/yyyy) format in the textboxes.
EDIT: ok i solved the problem. if anyone interested here is the new comparevalidator:
<asp:CompareValidator ID="Comp" ControlToValidate="txtEndDate" ControlToCompare="txtStartDate" Operator="GreaterThan" Type="Date" runat="server" Display="dynamic" Text="Failed!" />