comparevalidator control interprets date in the wrong format

Discussion in 'ASP .Net' started by VancouverMike, Apr 11, 2008.

  1. Hi there,

    I have a web app written in 1.1 in ASP.net 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:

    <globalization
    requestEncoding="utf-8"
    responseEncoding="utf-8"
    />

    I would appreciate any help from you.

    Regards,
    Mike
     
    VancouverMike, Apr 11, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Neo
    Replies:
    2
    Views:
    7,873
    adamyang
    Nov 28, 2007
  2. =?Utf-8?B?Q3liZXJMb3R1cw==?=

    Does CompareValidator work for the date in dd-mmm-yyyy format?

    =?Utf-8?B?Q3liZXJMb3R1cw==?=, Jun 10, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    15,866
    Peter Blum
    Jun 10, 2005
  3. Mike Rennie

    how python interprets re matches

    Mike Rennie, Dec 15, 2005, in forum: Python
    Replies:
    0
    Views:
    263
    Mike Rennie
    Dec 15, 2005
  4. Ed Prochak
    Replies:
    0
    Views:
    599
    Ed Prochak
    Apr 10, 2008
  5. Rahul
    Replies:
    4
    Views:
    632
    Rahul
    Apr 30, 2008
Loading...

Share This Page