Copied to clipboard

Flag this post as spam?

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


  • Tony Kiernan 278 posts 341 karma points
    Dec 03, 2013 @ 18:28
    Tony Kiernan
    0

    Related links datatype - "Object reference not set to an instance of an object."

    I've looked at the documentation and it reads as I'd expect. However whne I ima trying to use the related links datatype I am getting a null reference.

    I can output

    Model.Content.GetProperty("related").Value.Tostring()

    and it outpusts the content as a string. But

    Model.Content.GetPropertyValue<DynamicXml>("related")

    is throwing the null exception.

    Any ideas?

     

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Dec 03, 2013 @ 18:53
    Jeavon Leopold
    0

    Hi Tony,

    Are you using Umbraco v7 or v6?

    Could you post the exception and also the string value?

    Jeavon

  • Tony Kiernan 278 posts 341 karma points
    Dec 03, 2013 @ 19:08
    Tony Kiernan
    0

    Using 7

    DELETED THE EXCEPTION ETC AS IT IS IRRELEVANT TO THE SOLUTION BELOW
  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Dec 03, 2013 @ 19:10
    Jeavon Leopold
    100

    Ah cool, take a look at this new documentation for related links in v7 as it has changed so the Razor sample is slightly different.

  • Tony Kiernan 278 posts 341 karma points
    Dec 03, 2013 @ 19:34
    Tony Kiernan
    0

    Aha!  Cheers.

    I'll need to stop using google to find documentation

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Dec 03, 2013 @ 20:02
    Jeavon Leopold
    0

    np, actually maybe a note on the v6 editors linking to v7 version would also be useful :-)

Please Sign in or register to post replies

Write your reply to:

Draft