Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Is there a reason to use Html.Raw on RTE content in 4.11 razor views?
Html.Raw returns an HtmlString type.
When I do
@Model.Content.GetPropertyValue("bodyText").GetType()
It returns System.Web.HtmlString.
In order to use Html.Raw you need to first get the bodyText as a string:
@Html.Raw(Model.Content.GetPropertyValue("bodyText").ToString()) or@Html.Raw(Model.Content.GetPropertyValue<string>("bodyText"))
I could be wrong, but to me it looks like we are converting an HtmlString to a String just to convert it back to an HtmlString.
Am I missing something?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Leave out Html.Raw
Is there a reason to use Html.Raw on RTE content in 4.11 razor views?
Html.Raw returns an HtmlString type.
When I do
It returns System.Web.HtmlString.
In order to use Html.Raw you need to first get the bodyText as a string:
I could be wrong, but to me it looks like we are converting an HtmlString to a String just to convert it back to an HtmlString.
Am I missing something?
is working on a reply...