how can I automatically set ErrorMessage text to whatever is in the ValueToCompare?
a bit like Please enter a date less than {0} type of thing?
I change ValueToCompare in code-behind, does ErrorMessage need changed in code-behind too or can I use something like {0} ?
<asp:CompareValidator
ID="dateValidator" runat="server"
Type="Date"
ValueToCompare="30/11/2013"
Operator="LessThanEqual"
ControlToValidate="txtDateEnd"
ErrorMessage="Please enter a date less than 30/11/2013 "></asp:CompareValidator>
Does the date have any relevance is it always today's date or end of month date?
If it is todays date then there may be a way to do it in the markup or you could just change the message to be more generic such as 'Please enter a date before today' or 'Please enter a date before month end'.