Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CompareValdidator not working in French

Status
Not open for further replies.

mtessier

Programmer
Jun 25, 2008
37
US
Hello All,

I have a strange problem. The web application is ASP.NET 2.0 and it supports both en-ca and fr-ca cultures. By default, the site is in English but the user has the option to switch to French on the home page. This is the only page where the user can switch languages. We have a custom BasePage class to assign the appropriate Culture and UICulture for each page based on the user's selection on the home page. While we are allowing the culture to supply the number display format (French is 0,00 and English is 0.00), we are expecting English format as the number input format in text boxes (using regular expressions to enforce appropriate decimal places).

On a few pages, there are compare validator controls to check if a number is greater than/less than a particular number or control value. These validators are working well when the page is in English, but failing validation when the page is in French. Here is the validator code:

Code:
<asp:CompareValidator runat="server" ID="cpvAmount" ControlToValidate="mtbAmount" EnableClientScript="false" Type="Double" Operator="GreaterThan" ValueToCompare="0" Display="None" ValidationGroup="HSSAAccount" />

Note: The ErrorMessage property is dynamically supplied in code.

Thanks in advance,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top