I use jQuery Inputmask to add masks to my TextBox. But I need to add a mask when listing these fields (phone, cpf, etc). I use DisplayFor to list, but the mask does not work with it.
Code in my View:
Cargo: @Html.DisplayFor(model => model.sTelefone)
JavaScript Function:
<script>
jQuery(function ($) {
$("#sTelefone").mask("9999-9999");
});
Now when I use TextBoxFor, the mask works normally, however I only need to list the data in a dataTable, and the textBox does not answer me.
@Html.TextBoxFor(model => model.sTelefone)