Search code examples
dotnetnuke2sxc

2sxc - Field with HTML content


I need a field to store content with html code like:

This is my text<br>Text after paragraph

However, string fields will replace every symbol and outputs it with entity names like &lt;br&gt; when I output it in @Content.mystringwithhtml.

Is there any workaround besides creating a JS function to decode it?

Best regards, João


Solution

  • you need to use the HTML.Raw function create a multi line content field and choose the default wysiwyg edititor. THen add your HTML in teh editors html or raw view.

    then in your view use this:

    @Html.Raw(Content.YourField)