Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I want to enter two years old date from today date? How can i do that through customr validator or compare validator?
Posted

1 solution

You can use CompareValidator for the date type & RangeValidator for the
range. Example:

<asp:CompareValidator id="CompareValidator1" runat="server"
ErrorMessage="CompareValidator" Type="Date"
ControlToValidate="TextBox1"
Operator="DataTypeCheck">

<asp:RangeValidator id="RangeValidator1" runat="server"
ErrorMessage="RangeValidator" MaximumValue="2011-01-01"
MinimumValue="2009-01-01"
ControlToValidate="TextBox1">RangeValidator
<asp:TextBox id="TextBox1" runat="server">


Set the minimum value on page load.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900