@Html.HiddenFor does not work on Lists in ASP.NET MVC

后端 未结 13 929
灰色年华
灰色年华 2020-11-27 15:13

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

13条回答
  •  眼角桃花
    2020-11-27 15:43

    Another possible way to fix this would be to give each object in your List an ID, then use @Html.DropDownListFor(model => model.IDs) and populate an array which holds the IDs.

提交回复
热议问题