Search code examples
asp.net-mvc-2culture

System.FormatException in asp.net mvc application


I'm getting a System.FormatException at runtime because the system culture is set to Spanish in which ',' is the decimal separator, and the user enters the '.' as decimal separator (because he or she uses the numpad).

I tried setting the following in the web.config in order to set '.' as decimal separator but didn't work.

<globalization culture="en-US" uiCulture="en" />

I'm using telerik mvc numeric textbox and want to set the '.' as the decimal separator, so users can use the numpad to enter numbers.

Where do I set the decimal separator in a asp.net mvc application?


Solution

  • I would strongly recommend you reading the following blog post.