I have text formated with HTML saved in database. Now what I want to do is to get that text and send it view, with all html formating. But all I get is: & lt; p & gt;
Which is no exactly what I want. Any ideas how to get
Don't HTML encode in the view:
Razor:
@Html.Raw(Model.SomeHtmlStringComingFromTheDatabase)
WebForms:
<%= Model.SomeHtmlStringComingFromTheDatabase %>
Remark: by doing this you acknowledge that you fully understand the consequences of XSS attacks that your application becomes vulnerable to and that you do the necessary to sanitize this HTML if it comes from user input.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With