4
am starting my html.editorfor with "0.00" like this:
@Html.EditorFor(model => model.Preco, new { htmlAttributes = new { @Value = "0,00"} })
However, when the user receives a validation message (Modelstate.Isvalid=false), the editor loses the value and returns to "0.00". The question is: Could I start the editor with "0.00" and after the user type the new value I keep it even if the Modelstate.Isvalid returns false?
And if you pass instead of passing {Value = "0.00"}, go through {Value = model.Preco.Tostring("0.00")}, then the first time is just start the model (do not pass null) and after testing the Modelstate (in httpPost) pass the same model you received by parameter back to the view
– Marco Giovanni