Render a string with HTML elements?


My concern is that I have a string in my database in the following way:

'<a href="#" id="Manuel">@Manuel</a>&nbsp;hola'

When I have it in my model, it appears in the same way, and when I want to render the view it is shown that it is in the database, I do it in the following way:


How can I show it as if it belongs to DOM of the page?

asked by JuankGlezz 11.11.2016 в 19:07

1 answer


What I did was change the way the chain is displayed, for that use HtmlHelper.Raw of Razor .

Then my div stayed as follows:


Warning: If Notas_Inicio can be modified by a user, this opens the possibility that they insert arbitrary code into your page as malicious scripts. - Equidad

answered by 11.11.2016 / 19:07