Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
When i'm using Dropdown list multiple (typed used inside a loop of products) It does not return the string values like the documentation tells: https://our.umbraco.org/Documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/DropDown-List-Multiple
It returns: System.Linq.Enumerable+WhereSelectArrayIterator`2[System.String,System.String]
Can anyone tell me how i get the selected values?
Hi Ben,
You're right, the sample is incorrect.
Try this:
if (Model.Content.HasValue("testDropdown")) { <ul> @foreach (var item in Model.Content.GetPropertyValue<IEnumerable<string>>("testDropdown")) { <li>@item</li> } </ul> }
If you are using the models builder, it is simply:
@foreach (var item in Model.Content.TestDropdown) { <li>@item</li> }
Hi Matt
That did the trick, thanks :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco 7.7.4, Dropdown list multiple returns wrong string
When i'm using Dropdown list multiple (typed used inside a loop of products) It does not return the string values like the documentation tells: https://our.umbraco.org/Documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/DropDown-List-Multiple
It returns: System.Linq.Enumerable+WhereSelectArrayIterator`2[System.String,System.String]
Can anyone tell me how i get the selected values?
Hi Ben,
You're right, the sample is incorrect.
Try this:
If you are using the models builder, it is simply:
Hi Matt
That did the trick, thanks :)
is working on a reply...