The page sent to the browser only needs to handle the one date format of the
user. Your task is to identify the format of the user who is requesting the
page. Once done, you set
System.Threading.Thread.CurrentThread.CurrentUICul ture =
System.Globalization.CultureInfo.CreateSpecificCul ture("[the Culture Name]")
Please see the .net documentation for the CultureInfo class to understand
about Culture Names.
Here are some ways to identify the user's culture:
1. Have the user pick their culture as they enter the site and keep that
information in the Session
2. If the user logs in, keep their culture with their login data
3. The browser passes a list of culture names in Request.UserLanguages. See
the .net docs for that property. Be aware that often UserLanguages is an
empty collection and you need to provide a default.
There is one more way to do this: Show the format you want right on the
page.
--- Peter Blum
www.PeterBlum.com
Email:
PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
and "Peter's Date Package" at
http://www.peterblum.com/datecontrols/home.aspx
"Neo" <ne******@hotmail.com> wrote in message
news:ew****************@TK2MSFTNGP12.phx.gbl...
I use CompareValidator to validate a date. But CompareValidator can only
one date format at one time. if the dateorder is "mdy", date format can only
be mdy even if date format is ymd. But users of a web application may be
around the world and since database can accept many date format, so are
there any ways to let CompareValidator accept many data formats at one
time?
Thanks