When I use @ Html.Raw (mystring) normal, it correctly displays an example:
@{ ViewBag.Title = "My Site®"; } <title>@Html.Raw(ViewBag.Title)</title>
It will display <title>My Site®</title> correctly, but when I use it in the attribute:
<meta name="description" content="@Html.Raw(ViewBag.Title)" />
It displays <meta name="description" content="My Site&reg;" /> <meta name="description" content="My Site&reg;" /> , which is incorrect, because then it will not display the registered character.
How do you fix this behavior?
ddilsaver
source share