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.Threadin g.Thread.Curren tThread.Current UICulture =
System.Globaliz ation.CultureIn fo.CreateSpecif icCulture("[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.UserLan guages. 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****@PeterBlu m.com
Creator of "Profession al 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******@hotma il.com> wrote in message
news:ew******** ********@TK2MSF TNGP12.phx.gbl. ..
I use CompareValidato r to validate a date. But CompareValidato r 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 CompareValidato r accept many data formats at one
time?
Thanks