1
I use the Jquery MaskMoney in my inputs to treat the decimais, so far so good, but I noticed that when I type values above 1,000.00 where the MaskMoney plays me the point(.) in value, When I save the Bind of Mvc brings me that value Zeroed. But when the value is up thousand where the dot (999.99) the value arrives correct in Controller follows my Controller and my Model:
Controller
[HttpPost]
public ActionResult Editar(Produto produto, string returnUrl)
{
TempData["mensagem"] = "PRODUTO EDITADO COM SUCESSO!";
if (!String.IsNullOrEmpty(produto.Cest))
{
produto.Cest = produto.Cest.Replace(".", "");
}
produto.Codigo = produto.Codigo.Split(Convert.ToChar("."))[1];
ctx.Entry(produto).State = EntityState.Modified;
ctx.SaveChanges();
return Redirect("~" + returnUrl);
// return RedirectToAction("sucesso", "produto");
}
Model
public decimal Custo { get; set; }
View
<div class="col-lg-2">
<label for="Custo">Custo</label>
@Html.TextBoxFor(model => model.Custo, new { @class = "form-control decimal required" })
</div>
Sensational , it worked perfectly. Thank you very much
– Edenilson Bila