I need to display a data from a database which contains strings like & or «. When I try to display them through Html.Raw or Html.Encode, I’ve got dublicates values like & for Html.Raw and also bad output for Html.Encode.
What should I try? I use Razor syntax.
Example string: Hello, my name is Junior & I hate «bugs».
As per the comments at the top:
the
@Html.Raw(string)should be the proper syntax. Are you sure the string data in the database is not already escaped?