In the database, the CPF field is bigint and long in the model. I have two problems with this: 1) If the cpf starts with 0 or 00, it will not record this and then, to display on the screen, I will have to use algon as padleft (11) or similiar. 2) Since I have a cshtml that was generated based on the model, then I am not able to generate the mask in the field to type cpf. The problem is that in the bank, I will have different field sizes, so when the cpf starts with 0 or 00 and so it goes, I know that this would not be the problems, thanks to padleft (11).
<div class="form-group">
@Html.LabelFor(model => model.cpf, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.cpf, new { htmlAttributes = new { @class = "form-control", @id = "cpf" } })
@Html.ValidationMessageFor(model => model.cpf, "", new { @class = "text-danger" })
</div>
</div>
With the code above, I am not able to mask the field, for the reasons already presented. Does anyone suggest?