Copied to clipboard

Flag this post as spam?

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


  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    May 19, 2015 @ 10:14
    Jeroen Breuer
    0

    GetPropertyValue<HtmlString> not working

    Hello,

    We've got a live website and suddenly the content wasn't displayed anymore. The content was rendered like this:

    @(Model.Content.GetPropertyValue<HtmlString>("bodyText"))

    After switching it to this it did work again:

    @(Html.Raw(Model.Content.GetPropertyValue<string>("bodyText")))

    The first one did used to work so I don't know why only the second version now works.

    Running Umbraco 6.0.1.

    Jeroen

  • Gerty Engrie 130 posts 490 karma points c-trib
    May 19, 2015 @ 10:44
    Gerty Engrie
    0

    Did it stop working on all pages? Changed the content of those pages? I've had something like it a v6 and it had something to do with a change in content. For some reason razor didn't see it as a htmlstring but as another type & couldn't convert it to a htmlstring.. 

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    May 19, 2015 @ 10:47
    Jeroen Breuer
    0

    Yes it stopped working on all pages, but nothing changed on those pages. Apparently the website was offline this morning for a very short period and after that we got this problem.

    Jeroen

  • Urvish 252 posts 776 karma points
    May 19, 2015 @ 10:49
    Urvish
    0

    Hi Jeroen,

    I think it was the issue of the caching.

    If you have republished the entire site and restarted App Pool than it might work.

    Regards,

    Urvish Mandaliya

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    May 19, 2015 @ 10:49
    Jeavon Leopold
    0

    Do you know if any Windows updates were installed on the server?

    We had a similar situation a few days ago in C# (not Razor) where suddenly it stopped being able to convert string to HtmlString having worked previously...

  • Stephen 767 posts 2273 karma points c-trib
    May 19, 2015 @ 11:02
    Stephen
    0

    What's the property type of BodyText? Is there a property converter attached, that would natively return an IHtmlString? Can you try with IHtmlString vs HtmlString (notice the I for Interface)?

    Stephan

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    May 19, 2015 @ 11:05
    Jeroen Breuer
    0

    The BodyText is an RTE and no custom property converter is attached. I tried both IHtmlString and HtmlString, but they both stopped working.

    Jeroen

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    May 19, 2015 @ 14:03
    Ismail Mayat
    0

    Jeroen,

    Maybe off the mark but can you check your internal index not sure if it is used at all and if its borked?

    Regards

    Ismail

  • Stephen 767 posts 2273 karma points c-trib
    May 19, 2015 @ 17:09
    Stephen
    0

    Weird. Nothing in the log that would eg report that the converters are not initalizing properly?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    May 19, 2015 @ 17:25
    Jeroen Breuer
    0

    Nope didn't find anything. For now I'll just keep using Html.Raw with GetPropertyValue<string>.

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft