T
THaskell
I am using a comparevalidator to make sure that a date for a scheduling
app is not in the past.
<asp:CompareValidator id="cvSD" runat="server"
ControlToValidate="txtStartDate"
ErrorMessage="Dates cannot be in the past."
Display="Static"
Operator="GreaterThanEqual"
Type="Date" />
When the page is loaded I set the ValueToCompare of the validator to
DateTime.Now.Date. The validator will throw an error for some dates in
the future but not others. For example, today is 10/7 then 10/8 and
10/9 are valid but it throws the error for 10/10 - 10/31. 11/1 - 11/9
will be valid but 11/10 - 11/30 will cause an error, and so on.
Thanks. Any help will be much appreciated, this is very confusing.
app is not in the past.
<asp:CompareValidator id="cvSD" runat="server"
ControlToValidate="txtStartDate"
ErrorMessage="Dates cannot be in the past."
Display="Static"
Operator="GreaterThanEqual"
Type="Date" />
When the page is loaded I set the ValueToCompare of the validator to
DateTime.Now.Date. The validator will throw an error for some dates in
the future but not others. For example, today is 10/7 then 10/8 and
10/9 are valid but it throws the error for 10/10 - 10/31. 11/1 - 11/9
will be valid but 11/10 - 11/30 will cause an error, and so on.
Thanks. Any help will be much appreciated, this is very confusing.