I created my class with type int
[Required(ErrorMessage = "Preencha o Numero")]
[DisplayName("Numero")]
public int Number { get; set; }
Codeofview
:
<!--Number--><divclass="alinhado col-md-4">
<div class="form-group">
<div class=" alinhadoLabel">
@Html.LabelFor(model => model.Number,
htmlAttributes: new { @class = "control-label" })
</div>
<div class="alinhadoEditor">
@Html.EditorFor(model => model.Number,
new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Number, "",
new { @class = "text-danger" })
</div>
</div>
</div>
<!--End Number-->