Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Claushingebjerg 939 posts 2574 karma points
    Nov 11, 2015 @ 09:09
    Claushingebjerg
    0

    "'Newtonsoft.Json.Linq.JArray' does not contain a definition for" on list of nodes

    Im using the U7 grid data type package to do some repeated content. I need to sort these items and then take 1.

    BUT, i get the following error when trying to sort:

    'Newtonsoft.Json.Linq.JArray' does not contain a definition for 'OrderBy'
    

    My code is as follows

    @{
    var afholdelser = CurrentPage.afholdelser.OrderBy("afholdelsdato"); 
    foreach (var afholdelse in afholdelser) {
        <p>do stuff</p>
    }}
    

    What am i doing wrong?

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Nov 13, 2017 @ 17:53
    Alex Skrypnyk
    100

    Hi Claushingebjerg

    Do not use dynamic types for stuff like that.

    If you want to use OrderBy -> try to do it with strongly typed objects.

    What type of data are you storing in "afholdelser" property?

    Thanks,

    Alex

  • Claushingebjerg 939 posts 2574 karma points
    Nov 14, 2017 @ 07:35
    Claushingebjerg
    0

    I dont recall. The question is 2 years old, but thanks for your reply.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies