How could I put thousands separator in a textBoxFor()
?
Example:
Value entered in View
1.321 (The point is only to facilitate visually) and the
controller would receive the value 1321 to insert into the base.
My field is Int
and I use ValidationMessageFor()
. When I put the point it returns the error by the fact that it has a dot.
Codes:
View
@Html.TextBoxFor(model => model.contatoEfeitvo)
@Html.ValidationMessageFor(model => model.contatoEfeitvo)
Controller
if (ModelState.IsValid)
{
indicadoresmassivosp.status = (TempData["status"] ?? "2").ToString();
indicadoresmassivosp.dataAtualizacao = DateTime.Now;
indicadoresmassivosp.idUsuario = usuario.UsuarioId;
db.Entry(indicadoresmassivosp).State = EntityState.Modified;
db.SaveChanges();
return RedirectToAction("Index");
}