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 6150 posts 24110 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.

Please Sign in or register to post replies

Write your reply to:

Draft