473,400 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

CompareValidator, Dates, switching Thread culture, need help urgently

Hi,

I'm developing a web application available in multiple languages.

When we switch language (via a drop down list), we switch the culture of the
current thread:

System.Threading.Thread.CurrentThread.CurrentUICul ture = SelectedCulture;

the problem is that I use a CompareValidator on dates:

codebehind:
dateCompareValidator.ValueToCompare = DateTime.Today.ToShortDateString();
frontcode:
<asp:CompareValidator id="dateCompareValidator" runat="server"
ControlToValidate="dbFooterStatusEndDate" Type="Date"
Operator="GreaterThanEqual" display="none"/>

if the current thread culture is not the same than the application server
culture, then I got exception (I've switched to english culture but my
server is a french server)

Page : http://localhost/Nemo.WebApplication...h/default.aspx
Méthode : System.Web
Message d'erreur : La valeur '6/29/2005' de la propriété ValueToCompare de
'dateCompareValidator' ne peut pas être convertie en type 'Date'.
Nom de l'exception : HttpException
Stack Trace : at
System.Web.UI.WebControls.CompareValidator.Control PropertiesValid()
at System.Web.UI.WebControls.BaseValidator.get_Proper tiesValid()
at System.Web.UI.WebControls.BaseValidator.Render(Htm lTextWriter writer)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
.....
What is the solution to this problem?

Thanks alot.

Nicolas
Nov 19 '05 #1
0 1302

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Axel Dahmen | last post by:
Hi, I've got the same problem as described below. No answer found yet. Can someone please help? (I'm using .NET 1.0 on my development machine and 1.1 on my webserver. Like Susanna, I only get...
1
by: Neo | last post by:
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...
1
by: Jorge EA | last post by:
Hi there, According to the following article, a textbox for a date entry field can be validated with a CompareValidator: ...
8
by: Max | last post by:
My client has decided to use the Euro for the entire web site. Is there an easy way to get my ASP.NET app to format currency to Euro instead of US-dollar? Right now it's just reading the server...
1
by: Lars Netzel | last post by:
On Server1 when running my ASP:NET application and selecting records from an SQL server the Dates show up in Swedish Format (yyyy-mm-dd) this is good this is what I want. Right now we are...
3
by: THaskell | last post by:
I am using a comparevalidator to make sure that a date for a scheduling app is not in the past. <asp:CompareValidator id="cvSD" runat="server" ControlToValidate="txtStartDate"...
5
by: Fabian | last post by:
I am making a winforms-program in Visual Studio, that connects to an Access database. In the database all dates are presented in this format : dd-mm-yyyy. In my application I have a DatetimePicker,...
2
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
I am setting the current culture on the current thread in my global.asax.cs application_start() event as follows: System.Threading.Thread.CurrentThread.CurrentCulture = new...
0
by: =?Utf-8?B?VmFuY291dmVyTWlrZQ==?= | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.