I have a client registration page in my MVC project requesting default data like name, cpf, dt nasc ... I need to create masks of these fields.
After searching I came to the DigitalBush plugin. So I liked it and I want to adhere to it. How should I do it?
I've already put "jquery.maskedinput.js" in the Scripts directory.
In my Index.cshtml I have this:
@model IEnumerable<Estacionamento.Models.Estacionamento_Cliente>
@{
ViewBag.Title = "Index";
}
<h2>Bem vindo</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.Cliente_Nome)
</th>
<th>
@Html.DisplayNameFor(model => model.Cliente_CPF)
</th>
<th>
@Html.DisplayNameFor(model => model.Cliente_RG)
</th>
<th>
@Html.DisplayNameFor(model => model.Cliente_End)
</th>
<th>
@Html.DisplayNameFor(model => model.Cliente_Numero_Endereco)
</th>
<th>
@Html.DisplayNameFor(model => model.Cliente_DDD)
</th>
<th>
@Html.DisplayNameFor(model => model.Cliente_Tel)
</th>
@*<th>
@Html.DisplayNameFor(model => model.Dta_Cadastro)
</th>*@
<th>
@Html.DisplayNameFor(model => model.Dta_Nascimento)
</th>
@*<th>
@Html.DisplayNameFor(model => model.Flg_Situacao)
</th>*@
<th>
@Html.DisplayNameFor(model => model.Cliente_Email)
</th>
<th></th>
</tr>
@foreach (var item in Model) {
string cpf = (item.Cliente_CPF).ToString();
string rg = (item.Cliente_RG).ToString();
string ddd = (item.Cliente_DDD).ToString();
string telefone = (item.Cliente_Tel).ToString();
string data = Convert.ToDateTime(item.Dta_Nascimento).ToShortDateString();
<tr>
<td>
@Html.DisplayFor(modelItem => item.Cliente_Nome)
</td>
<td>
@Html.DisplayFor(modelItem => cpf)
</td>
<td>
@Html.DisplayFor(modelItem => rg)
</td>
<td>
@Html.DisplayFor(modelItem => item.Cliente_End)
</td>
<td>
@Html.DisplayFor(modelItem => item.Cliente_Numero_Endereco)
</td>
<td>
@Html.DisplayFor(modelItem => ddd)
</td>
<td>
@Html.DisplayFor(modelItem => telefone)
</td>
@*<td>
@Html.DisplayFor(modelItem => item.Dta_Cadastro)
</td>*@
<td>
@Html.DisplayFor(modelItem => data)
</td>
@*<td>
@Html.DisplayFor(modelItem => item.Flg_Situacao)
</td>*@
<td>
@Html.DisplayFor(modelItem => item.Cliente_Email)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.Id_Cliente }) |
@Html.ActionLink("Details", "Details", new { id=item.Id_Cliente }) |
@Html.ActionLink("Delete", "Delete", new { id=item.Id_Cliente })
</td>
</tr>
}
</table>