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

Grouping with Data Entities

Linq - Data Entities - Records by Max Date with CASE

Linq Remove from list based on other table