Normally the CompareValidator is used to check one value against another on ASP.NET page. However it also can be used to ensure user has entered data in a correct format.
Here's how it works:
Note: this method is culturally sensitive. This means that if you change your browsers settings to en-UK, a date of 1-28-01 correctly fires the validator, while 28-1-01 is allowed through. This is because the date format is day-month-year in that region.
Hi, Thank you for this TIP. Very simple and so useful. Regards Prakash
prakash Babu 3/9/2008 9:30:02 AM
Great tip! Another one to add to my "I wish I'd known this X days/weeks/months ago" list :)
Ian Oxley 3/27/2008 11:51:45 AM
Great...its working,,,so nice and simple yet powerful... Thanks
Mehboob Ali 12/10/2009 9:30:46 AM