3
votes

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?

1
Are you sure? HTML5-validation (<input type="number" min="0.00" step="0.01">) 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
It definitely is a comma - just double checked :/ - adrian
What exactly did your set in web.config? Please post the line and the name of the section. - splattne
If someone have the same issue, this solution work for me : stackoverflow.com/questions/14322910/… - Portekoi

1 Answers

3
votes

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