I bring the data to the view via ViewData, sample code:
if (ViewData["post"] != null) { var post = ViewData["post"] as PostFull; string keywords = ""; post.passage = System.Text.RegularExpressions.Regex.Replace(post.passage, "<[^>]+>", string.Empty); <title>@post.title</title> <meta name="title" content="@post.title"> <meta name="description" content="@post.passage"> foreach (var tg in post.tags) { keywords += tg[1] + ","; } <meta name="keywords" content="@keywords"> }
and at the exit I have:
<title>&#x41F;&#x435;&#x440;&#x432;&#x43E;&#x43D;&#x430;&#x447;&#x430;&#x43B;&#x44C;&#x43D;&#x430;&#x44F; &#x43D;&#x430;&#x441;&#x442;&#x440;&#x43E;&#x439;&#x43A;&#x430; Brocade ICX 6450, Ruckus ICX 7150</title>
data in the PostFull class is collected from the database. Moreover, if you print @ html.raw, then everything is displayed normally, but for me it is somehow not correct. The browser itself in both cases displays as it should, but in the HTML source code these are the cracks.
How can I overcome this?