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
Hi there,
I have a really simple issue: I'm trying to receive the values from a checkbox list like so:
foreach (var item in project.GetPropertyValue<string>("projectCategories").Split(',')){<p>@item</p>}
But I end up getting the following output instead of the expected values:
System.Linq.Enumerable+WhereSelectArrayIterator`2[System.String,System.String]
I cant see where I'm going wrong...
Any ideas?
What does
<pre>@project.GetPropertyValue<string>("projectCategories")</pre>
output? So you can get a better look at the saved value instead of trying to split it directly.
This is the direct Output value:
Looks like your values aren't stored as a string, but as an IEnumerable.
Try the following:
foreach (var item in project.GetPropertyValue<IEnumerable<string>>("projectCategories")) { <p>@item</p> }
Tobias,
that did the trick! Thank you very much for your help!
No worries, glad I could help :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get checkbox values
Hi there,
I have a really simple issue: I'm trying to receive the values from a checkbox list like so:
But I end up getting the following output instead of the expected values:
I cant see where I'm going wrong...
Any ideas?
What does
output? So you can get a better look at the saved value instead of trying to split it directly.
This is the direct Output value:
Looks like your values aren't stored as a string, but as an IEnumerable.
Try the following:
Tobias,
that did the trick! Thank you very much for your help!
No worries, glad I could help :)
is working on a reply...