I have a web page with the next TextBox:
<asp:TextBox ID="txtSum" runat="server"></asp:TextBox>
and compareValidator to validate it:
<asp:CompareValidator ID="CompareValidator1" runat="server" Display="Dynamic" ControlToValidate="txtSum" ErrorMessage="less than 0" ValueToCompare="0" Type="Double" Operator="GreaterThan">
</asp:CompareValidator>
when I set Culture of the page to Russian, the compare validation does not work well.
I found the reason is that format number is different between English and Russian.
I tried to change the format as follow:
NumberFormatInfo format = CultureInfo.CreateSpecificCulture("en-US").NumberFormat;
Thread.CurrentThread.CurrentCulture.NumberFormat = format;
but it does not work. in debug I see the NumberFormat of culture has changed but in the page I get the message less than 0.
how can I solve it?