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;"})

Comments

Popular posts from this blog

Linq - Data Entities - Records by Max Date with CASE

Localizer in Controller

Linq Remove from list based on other table