2
I use jQuery Inputmask to add masks to my Textbox. However, 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 the same.
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, but I just need to list the data in a datatable, and the textbox doesn’t suit me.
@Html.TextBoxFor(model => model.sTelefone)