jeudi 30 juillet 2015

Encountered Validation Error in double? datatype in MVC3 C#

Hi guys I am new to Mvc 3 and previously while debugging my Project, I encountered an error in the field of Miles , and a very unusual error appeared that says The field Miles must be a number. upon entering .2 and 135. whereas it will be automatic that the value before and after the decimal point is zero, it is preventing me from saving the values and now I'm here searching for solutions.

I hope someone can help me with this.

This is my code snippet:

   <div class="label">
      @Html.LabelFor(m => m.Miles) @Html.ValidationMessageFor(m => m.Miles)
   <div class="field">
      @Html.TextBoxFor(m => m.Miles)

and here is my datatype in my Model:

public Nullable MILES { get; set; }

Aucun commentaire:

Enregistrer un commentaire