I have a salary TextBox and an associated CompareValidator, which is setup as follows:
<asp:CompareValidator ... Operator="DataTypeCheck" Type="Currency" />
I fill the TextBox with a formatted string out of the database:
txtSalary.Text = myObject.Salary.ToString("N2")
When a user accesses the page using a French culture (such as fr-ca), the ToString method will put 80 000,00
in the textbox, which is fine.
However, any number with a space in it causes the validator to fail, which is not fine. Is there any way to make the CompareValidator work properly with non-US formatted numbers?