I have this line of code here in my view
I have this string @Model.inventory.overview
and it has —
in it.
When I try to use it so it will display the special html character it shows up as the text —
@Html.Raw(Model.inventory.overview)
and
@MvcHtmlString.Create(Model.inventory.overview)
This is what @Model.inventory.overview
is
Lorem ipsum dolor sit
—
amet, consectetur adipiscing elit. Mauris eget feugiat nibh. Fusce rhoncus ex et nunc fringilla, ut fermentum tortor volutpat. Praesent mollis efficitur magna auctor sollicitudin. Morbi pulvinar, justo ut efficitur rutrum, dui metus varius magna, vitae molestie leo elit vel turpis. Nullam quis ipsum nec erat maximus dictum sit amet sed ligula. Vestibulum tincidunt dolor non—
justo accumsan, eu euismod neque rutrum. Donec in lacinia est.
I have also tried the following:
@Html.Raw(HttpUtility.HtmlDecode(@model.ContentBody));
Still not working.
@Html.Raw(Model.inventory.overview)
should work. If it's not then your doing something unusual that you've not shared. There's nothing more anyone can add to this question unless you create a Minimal, Complete, and Verifiable example of your problem – Liam—
– Tieson T.