I am trying to display messages from one user to another on the site. Messages are saved in a database with the HTML.
Why is the HTML on the site, showing up, instead of turning the HTML into a link or a line break?
Here is the code:
@foreach (var m in Model.User.MessagesUsers)
It looks like you're using ASP.NET MVC. The framework automatically HTML-encodes the output for security reasons.
You can get around that by using
Be aware however that this is circumventing security. Make sure you trust your data. This is how cross-site scripting attacks happen. You might also want to look into something like Markdown to allow users to enter markup over which you have more control.