I cannot figure out why the properties won’t set for this control. Here’s the control code:
@Html.DropDownList("SetViewModel[" + i + "].Value", new SelectList(@Model.Datasource.Where(c => c.listId == setting.Datasource).Select(c => c.value), "value", "description", setting.Value))
The error I continue to get is: “DataBinding: ‘System.String’ does not contain a property with the name ‘value’. “ But the property names seem to be “value” and “description.” How can I confirm that I have the right property names? The Model.Datasource traces back to the ORM which has properties of “value” and “description.” When I step through the code and hover over the setting.Datasource text I see properties called “value” and “description.” I’m very confused. Has anyone dealt with this before? Thank you!
You’re trying to pass a set of objects, not strings.
Remove the
Selectcall.