0
I’m passing an object that has following property to Action:
{
...
Valor : "3500.00"
}
Financapessoalviewmodel:
public class FinancaPessoalViewModel
{
...
public decimal Valor { get; set; }
}
Action:
[HttpPost]
public ActionResult AdicionarLancamento(FinancaPessoalViewModel financa)
{
var errors = ModelState.Values.SelectMany(v => v.Errors);
//The value '3500.00' is not valid for Valor.
...
}
It is always coming 0 to the property "Value", he is unable to do Binding. How to fix this?
If you pass the value as
3500,00
(comma) it works?– Jéf Bueno
This is different culture problem, for sure if you pass ',' instead of point as told by our friend jbueno will work. And you can get around that by using this reply =]
– Brunno
Oh yes, thanks guys! That’s right. I didn’t understand because C# only "understood" decimal with a dot, and not with a comma.
– Raphael