2
I have a customer registration page in my MVC project requesting standard data such as name, Cpf, dt nasc... I need to create masks of these fields.
After researches I reached the plugin offered by Digitalbush. So I liked it and want to join it. How should I do?
I 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>
In the link that you made available the plugin has all the examples on the first page.
– Aline
Yes, but it doesn’t tell me where to put everything. For example, in the first part there is the script, where do I put it? And then several jQuery, where do I put it? Everything in the Index.cshtml file?
– Felipe Moura Shurrab