How to get Commas in your razor Html.TextBoxFor
There are so many ways to do this ... but depending on circumstances they don't always work. The simplest way is to apply the format directly on the Textbox like this:
@Html.TextBoxFor(model => item.Population, "{0:N0}",new {style = "width: 100px;"})
@Html.TextBoxFor(model => item.Population, "{0:N0}",new {style = "width: 100px;"})
Comments