Click here to Skip to main content
15,902,299 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,


Please give me the Regular Expression for checking the date does not less than today's date for RegularExpressionValidator.


Please give me solution...
Posted

You can better use a comparevalidator.
<asp:comparevalidator runat="server" id="cvDate" operator="GreaterThen" type="DateTime" ... /> 

In the onload you set the ValueToCompare property of the comparevalidator to today
cvDate.ValueToCompare = DateTime.Now;
 
Share this answer
 
v2
A regular expression validator cannot do that - it can only check text strings, not compare values such as dates. Regexes do not know what todays date is! And besides - is that todays date in Server time, Client time, or UTC?

As K Herms suggests, use a compare validator instead.
 
Share this answer
 
for that you used comapre validator and check with taht the given control value is greate than to tday date

<asp:CompareValidator Operator="GreaterThanEqual" Type="Date"
ControlToValidate="txbEndDate" ControlToCompare="txbStartDate"
ErrorMessage="error!" runat="server" />
 
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