Reputation: 51
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».
Upvotes: 4
Views: 6337
Reputation:
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?
Upvotes: 12