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