Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > comparevalidator control interprets date in the wrong format

Thread Tools

comparevalidator control interprets date in the wrong format

Posts: n/a
Hi there,

I have a web app written in 1.1 in and C#. In the web app, I need to
compare two dates (from and to) from two textboxes on webpage to make sure
the to date is greater than or equal to from date, by using comparevalidator
control. The app is working fine in production server, but recently when I
put the code into development environment (Windows 2000 server), the
comparison is not working properly. Even I set the date format in Regional
Setting in Control Panel to be "dd/MM/yyyy", and the value in the two
textboxes are correct, the validator control still complains and shows error
message. It seems that the code always interprets the date in MM/dd/yyyy
format. I am wondering if I need to set some culture information for the
whole site so the whole site will interpret the date in the consistent
format? In my web.config file this is the globalization section:


I would appreciate any help from you.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Keil c51 interprets &Array as Array. Is that normal? Ed Prochak C Programming 0 04-10-2008 05:03 PM
use CompareValidator to validate date format Neo ASP .Net 2 11-28-2007 11:50 PM
how python interprets re matches Mike Rennie Python 0 12-15-2005 07:51 PM
Does CompareValidator work for the date in dd-mmm-yyyy format? =?Utf-8?B?Q3liZXJMb3R1cw==?= ASP .Net 3 06-10-2005 04:37 PM
problem of CompareValidator control ( for check date) pc ASP .Net Web Controls 0 03-07-2004 03:09 PM