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.
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" />
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.
Notice the text has turned to raw html.
Thanks for your help.
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
Hi Jan.
It's Razor and it's @Model.contentBody
Hi Atoosa,
You can use
@Html.Raw(Model.contentBody)
in Razor.Hope it helps.
Regards,
Urvish Mandaliya
yes been trying that and it says: The best overloaded method match for 'System.Web.WebPages.Html.HtmlHelper.Raw(string)' has some invalid arguments!
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.
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
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
is working on a reply...