Razor - @Html.Raw() still encoding & in meta tag attributes
asp.net-mvc, asp.net-mvc-3, asp.net-mvc-4, razor
Solution
As patridge pointed out in his answer you can just include the attribute markup in the parameter to `.Raw`.
In your case that would result in something similar to the following:
<meta name="description" @Html.Raw("content=\"My Site&reg;\"") />
Problem
When I use @Html.Raw(mystring) normal it renders properly example: ``` @{ ViewBag.Title = "My Site®"; } <title>@Html.Raw(ViewBag.Title)</title> ``` Will properly render `<title>My Site®</title>` but when I use it in an attribute: ``` <meta name="description" content="@Html.Raw(ViewBag.Title)" /> ``` It renders `<meta name="description" content="My Site&reg;" />` which is not correct because then it will not render the registered mark. How do you correct this behavior?