Thursday 18 December 2014

Create A Dropdown List with A Range of Numeric Values in ASP.NET MVC 4

If you want to have a dropdownlist list containing a range of numerical values here's how to do it:

Source: http://stackoverflow.com/questions/12070363/dropdown-list-asp-mvc

@{ var values = new SelectList(Enumerable.Range(0, 60)); }

@Html.DropDownListFor(model => model.NoOfUserAccounts,values)
@Html.DropDownListFor(model => model.NoOfUserAccounts)s)