My text is not html?

I use ckeditor to save my texts ... (asp.net mvc)

The text is saved in the database as follows:

<ul><li>List item</li><li>List item</li><li>List item</li></ul>

And when I launch my site, I want it to look like this:

  • List item
  • List item
  • List item

But the text is the same as in the database:

<ul><li>List item</li><li>List item</li><li>List item</li></ul>

And the source code:

  &lt;ul&gt;
    &lt;li&gt;
        List item&lt;/li&gt;
    &lt;li&gt;
        List item&lt;/li&gt;
    &lt;li&gt;
        List item&lt;/li&gt;
&lt;/ul&gt;

What am I missing?

+3
source share
2 answers

Your text is encoded in HTML format, if, for example, you use it <%: Prop %>, this will happen if you want it to be displayed exactly what you want <%= Prop %>. There are dozens of ways to get the HTML code on the page, so I'm not sure which method you are using, but in any way, it goes through the Html encoder along the way.

, , , , , HTML.

+5

Source: https://habr.com/ru/post/1761486/


All Articles