8

I'm facing a rather weird issue. I have an ASP.Net website that basically allows users to deposit money into a fake account. I have some validation on the input amounts and it has a min value of 0.00. However, when I load the page and check "min value" it is 0,00 - so when the check happens on the backend the min value is 0,00 (note the separator) and it breaks/is invalid.

I set VS to use the correct culture in my config, I have set my decimal to default to use a full stop separator system side (in region/locale settings) and my IIS .Net Globalization is set to use the correct culture. However, whenever I load a page it defaults to 0,00 instead of 0.00. Is there anywhere else I need to change it?

When my friend hosts the same site on his PC the min value is 0.00 - we've checked and all our number formats and culture stuff seems the same. Is there anything I might be missing?

adrian
  • 2,786
  • 2
  • 18
  • 33
  • Are you sure? HTML5-validation () uses invariant culture ("0.00") while parsing the attributes and posting the data, but the data _presented_ should match your local system where you're running the browser. Could you verify using Firebug/developer tools that the value posted actually contains a comma? – sisve May 12 '15 at 09:17
  • It definitely is a comma - just double checked :/ – adrian May 12 '15 at 09:21
  • What exactly did your set in web.config? Please post the line and the name of the section. – splattne May 12 '15 at 09:29
  • If someone have the same issue, this solution work for me : http://stackoverflow.com/questions/14322910/cultureinfo-values-differ-between-applications-for-the-same-culture-is-this-a-b – Portekoi Dec 05 '16 at 15:15

1 Answers1

6

Your Windows/.NET Framework is probably a non-English installation? Did you use this line in your web.config

Example for US English:

<configuration>
    <system.web>
        <globalization uiCulture="en" culture="en-US" />
        ...

See: How to: Set the Culture and UI Culture for ASP.NET Web Page Globalization

splattne
  • 102,760
  • 52
  • 202
  • 249