Copied to clipboard

Flag this post as spam?

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


  • Søren Kottal 530 posts 3521 karma points MVP 2x c-trib
    May 08, 2015 @ 11:54
    Søren Kottal
    0

    IContent does not contain a definition for SetValue when trying to add serialized Json

    For some reason, I can't add JSON data serialized to a string in SetValue().

    Look at this example:

     

            var newEntries = JsonConvert.SerializeObject(entries).ToString();

            var newEntries2 = "{\"Entries\":[{\"Name\":null,\"Phone\":\"123455\",\"Message\":\"Test\",\"Date\":\"2015-05-08T11:47:50.0421163+02:00\"}]}";


            property.SetValue("ctaEntries", newEntries);
            property.SetValue("ctaEntries", newEntries2);

    Line 4 (newEntries2) works, Line 3 doesn't. 

     

    I don't get it...

     

  • Søren Kottal 530 posts 3521 karma points MVP 2x c-trib
    Dec 01, 2015 @ 13:49
    Søren Kottal
    100

    Stumbled on to this problem again, the solution seems to be to write the following in stead:

    property.Properties["ctaEntries"].Value = newEntries;

  • 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