Copied to clipboard

Flag this post as spam?

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


  • AIG 3 posts 94 karma points
    May 09, 2019 @ 02:49
    AIG
    0

    RTE NullReferenceException with Umbraco 8

    Hello, On Umbraco 8.0.2, when trying to render the RTE content in razor view i always get NullReferenceException no matter what i do, debugging through the model i eventually can see the RTE property in visual studio populated with HTML (specifically HtmlString) but once the code execute to get it i get NullReference Exception.. all the below trials failed:

    Model.Value<string>("rteAlias")
    Model.Value<HtmlString>("rteAlias")
    Model.Value<IPublishedContent>("rteAlias")
    Model.Value("rteAlias")
    Model.RteAlias
    Model.GetProperty("rteAlias")
    

    Note: Model itself is not null, the template can successfully get other non-rte properties from it.

    How to get the content of RTE in umbraco 8?

  • AIG 3 posts 94 karma points
    May 09, 2019 @ 18:43
    AIG
    101

    After several debugging i found what the issue is .. i am using multiple RTEs on the same page, one of them had a typo in the alias name.. the problem is the exception error was blaming a correct RTE for NullReference while leaving the faulty one unmentioned. weird, but that was the fix.

  • 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