Asp.net mvc 4 MVC Razor-页面元标记中未呈现特殊字符

Asp.net mvc 4 MVC Razor-页面元标记中未呈现特殊字符,asp.net-mvc-4,razor,meta-tags,Asp.net Mvc 4,Razor,Meta Tags,我正在尝试在MVC4应用程序中添加页面元标记。 这是我的布局的标题: <title>@Html.Raw(Model.CurrentPageMetaTags.Title)</title> <meta name="description" content="@Html.Raw(Model.CurrentPageMetaTags.Description)" /> <meta name="keywords" content="@Html.Raw(Model.Cu

我正在尝试在MVC4应用程序中添加页面元标记。 这是我的布局的标题:

<title>@Html.Raw(Model.CurrentPageMetaTags.Title)</title>
<meta name="description" content="@Html.Raw(Model.CurrentPageMetaTags.Description)" />
<meta name="keywords" content="@Html.Raw(Model.CurrentPageMetaTags.Keywords)" />
但在浏览器中,它会显示元标记,如下所示:

<title>Current page's title</title>
<meta name="description" content="Current page&#39;s description" />
<meta name="keywords" content="Current page&#39;s keywords" />
当前页面的标题

标题没有问题,但描述和关键字没有呈现特殊字符我认为这可能会帮助您:

@Html.Raw(WebUtility.HtmlDecode(Model.CurrentPageMetaTags.Title))

干杯

有什么问题吗?“不呈现”是什么意思?元标记不会呈现。是@CodeCaster。撇号没有在元描述和关键字中呈现!再说一遍,你这是什么意思?元标记不会被渲染。你认为“渲染”是什么意思,你希望得到什么样的输出?@CodeCaster撇号显示为#39;在元描述和关键字内容中!这个问题有什么解决办法吗?那不是问题。我也相当肯定,这只是你的浏览器向你展示的。你在看源代码还是DOM?请解释为什么你认为它是OP问题的答案。如果这是你想要OP尝试的建议,你可以作为comment@shwnz谢谢你的回答,问题解决了。代码没有问题,它以这种方式显示在源代码中!
@Html.Raw(WebUtility.HtmlDecode(Model.CurrentPageMetaTags.Title))