devnewbee
asked on
Compare Validator: Using Dateadd to compare dates in c#
I have the following code working in VB.
How can I achieve the same in c#?
How can I achieve the same in c#?
<asp:CompareValidator ID="Check14DayRule" runat="server" ControlToValidate="txtStartDate"
ValueToCompare='<%# DateAdd(DateInterval.Day, 14, Now()).ToString("MM/dd/yyyy") %>'
ErrorMessage="The training must be more than 14 days away" Display="None" Type="Date"
Operator="GreaterThanEqual" EnableClientScript="False"></asp:CompareValidator>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The error I get is:
CS0103: The name 'DateAdd' does not exist in the current context