I'm pulling a summary into a template. The html in the summary is not being rendered. Is there a way to autoescape so the code renders? Code snippet is below and the specific call is {{project.Summary}}
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1525: Invalid expression term '{'
Source Error:
Line 158:
Line 159:
Line 160: @Html.Raw({{project.Summary}})
Line 161:
Negative, that did not work. I see the following error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'project' does not exist in the current context
Source Error:
Line 158:
Line 159:
Line 160: @Html.Raw(project.Summary)
Line 161:
Content not rendering HTML
I'm pulling a summary into a template. The html in the summary is not being rendered. Is there a way to autoescape so the code renders? Code snippet is below and the specific call is {{project.Summary}}
Hi Clickfarm,
If you are pull out your data using Razor then you can use this method.
Then you should get the HTML outputtet as well.
https://umbraco.tv/videos/umbraco-v7/implementor/working-with-umbraco-data/razor-syntax/htmlraw/
Hope this helps,
/Dennis
Tried that and get the following:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1525: Invalid expression term '{'
Source Error:
Line 158:
Hi Clickfarm,
So you are in Razor right. Then you should do something like this. If not then it would be great if you could show the code that you have so far.
Hope this helps,
/Dennis
Negative, that did not work. I see the following error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'project' does not exist in the current context
Source Error:
Line 158:
Below is my code. Line 160 is causing the issue.
Hi Clickfarm,
Okay so you have a variable called Summary
So what if you do something like this.
Hope this helps,
/Dennis
Negative. Different error.
Compiler Error Message: CS0103: The name 'Summary' does not exist in the current context
Source Error:
Line 158:
Hi Clickfarm,
you are not using razor, you are using angular.
Have a look at https://docs.angularjs.org/api/ng/directive/ngBindHtml To render HTML with angular.
Regards David
is working on a reply...