M
M
masterOk2012-02-24 17:09:44
ASP.NET
masterOk, 2012-02-24 17:09:44

HTML output from ASP.NET MVC DB?

The question is how to display HTML from the database on ASP.NET MVC? i.e. in the database there is text with tags, you need to make it so that it is displayed on the page not as text, but as html. Now the output is done like this @Html.DisplayFor(modelItem => item.Body); I found that I need to use @HTML.RAW() but if I write @HTML.RAW(modelItem => item.Body) then I get an error how to solve this problem?
The HTML is generated using TinyMCE.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
KLUBS, 2012-02-25
@masterOk

Maybe just @Html.Raw(item.Body)?

B
ByTheWay, 2012-02-25
@ByTheWay

Here is stackoverflow.com/questions/6635310/database-field-containing-html-display-raw-text

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question