I'm using MVC3 + Razor.
I'm sending a parameter on a textbox to a Controller.
I'm using the "es-AR" globalization.
I want a float number to have this format: "9,99" (comma as a decimal separator)
When I put a "comma separator" number in the textbox, the controller receives NULL on the "weight"variable. When I put a "dot separator", the weight float variable is OK.
View:
@Html.TextBox("weight")
(Basically, this is a search field. )
Controller:
public ActionResult UserQueryPage(float? weight )
web.config:
<system.web>
<globalization uiCulture="es" culture="es-AR" />
Is there anything else that I can do about it? Any tip?
Thanks!
<globalization uiCulture="es" culture="es-AR" />should work. I am unable to reproduce the issue. Could you please post a full example including your controller and view allowing to illustrate the problem? By the way are you using AJAX?