How can I allow period and comma as valid decimal point separators for floats?

我希望允许“123.45”和“123,45”作为有效的小数输入,但是当前“123.45”的结果是"The value '123.45' is not valid for Foo"


You have to use Globalization. Globalization allows you to customize your numeric inputs for different locales. Have a look at the following article:

Globalizing ASP.NET MVC Client Validation
http://haacked.com/archive/2010/05/10/globalizing-mvc-validation.aspx

链接地址: http://www.djcxy.com/p/47066.html

上一篇: 是HTML 5 + CSS 3> = Microsoft Silverlight

下一篇: 我如何允许句点和逗号作为浮点数的有效小数点分隔符?