I\'m using a model that contains a List as a property. I\'m populating this list with items i grab from SQL Server. I want the List to be hidden in the view and passed to th
The foreach loop instead of a for loop might be a slightly cleaner solution.
foreach
for
@foreach(var item in Model.ToGroups) { @Html.HiddenFor(model => item) }