Copied to clipboard

Flag this post as spam?

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


  • Atoosa Khoda 96 posts 148 karma points
    Apr 20, 2015 @ 02:02
    Atoosa Khoda
    0

    html code appearing on front end.

    I'm using Umbraco 4.7 for this website. Sometimes the content appears in html on the front side and then it fixes it itself before i even get a chance to look at it. What is the reason for this random behavior and why is it happening? This is a screenshot client has provided.

    enter image description here

    Notice the text has turned to raw html.

    Thanks for your help.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 20, 2015 @ 05:55
    Jan Skovgaard
    0

    Hi Atoosha

    What does your code for rendering the page content look like? If you're using XSLT make sure to add the disable-output-escaping="yes" attribute to the <xsl:value-of select="xpath" /> so it looks like <xsl:value-of select="xpath" disable-output-escaping="yes" />

    Looking forward to hearing from you.

    /Jan

  • Atoosa Khoda 96 posts 148 karma points
    Apr 29, 2015 @ 07:16
    Atoosa Khoda
    0

    Hi Jan.

    It's Razor and it's @Model.contentBody

  • Urvish 252 posts 776 karma points
    Apr 29, 2015 @ 07:23
    Urvish
    0

    Hi Atoosa,

    You can use @Html.Raw(Model.contentBody) in Razor.

    Hope it helps.

    Regards,

    Urvish Mandaliya

  • Atoosa Khoda 96 posts 148 karma points
    Apr 29, 2015 @ 07:28
    Atoosa Khoda
    0

    yes been trying that and it says: The best overloaded method match for 'System.Web.WebPages.Html.HtmlHelper.Raw(string)' has some invalid arguments!

  • Atoosa Khoda 96 posts 148 karma points
    Apr 29, 2015 @ 07:36
    Atoosa Khoda
    0

    I've changed to @Html.Raw(Model.GetProperty("contentBody").Value) will see how it goes. It's a bit random so will have to wait and see if reoccurs.

  • Urvish 252 posts 776 karma points
    Apr 29, 2015 @ 07:37
    Urvish
    0

    Atoosa,

    Try to clean the code and than rebuild. May it can solve the issue.

    And also see below post.

    https://our.umbraco.org/forum/getting-started/installing-umbraco/26057-issue-after-upgrade-to-471

    Hope it helpful to you.

    Regards,

    Urvish Mandaliya

  • Urvish 252 posts 776 karma points
    Apr 29, 2015 @ 07:40
    Urvish
    0

    ok. Let me know if its reoccurs.

    And if you binding your custom model with filled property values than no need to use @Html.Raw(Model.GetProperty("contentBody").Value) i think.

    Regards,

    Urvish Mandaliya

Please Sign in or register to post replies

Write your reply to:

Draft