I have a Property that is an IEnumerable
public IEnumerable<string> ChangesOthersResult { get; set; }
I need to collect all values from ChangesOthersResult and post from a view back to the controller. How can I loop through the Ienumerable and create hidden fields that will bind back to the ViewModel in the controller?
foreach(var item in Model.ChangesOthersResult)
{
@Html.HiddenFor(x => x.ChangesOthersResult);
}
Is giving me the Raw SQL statement as text.
Convert ChangesOthersResult to an array and use a for loop to output something like this: