I have a class like:
public class Item
{
public int ItemID { get; set; }
[Display(Name = "Value")]
[Column(TypeName = "money")]
public decimal Value{ get; set; }
}
In the form I enter 12.50 and in my post Action the object has Item.Value = 1250 when should have 12.50, How to fix this?
The Action Method:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create(Item item)
{
...code...
}
View:
<div class="editor-label">
@Html.LabelFor(model => model.Value)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Value)
@Html.ValidationMessageFor(model => model.Value)
</div>
When type 12. the validation client side say 'The field Valor must be a number.' however let me execute post action method, with 12, say the same thing but don't let me.