元标记描述中的特殊HTML字符

时间:2022-12-17 19:39:34

My metatag description contains a text with accents or special caracteres. I'm creating it in Controller MVC and I send to view through of viewbag.

我的metatag描述包含带有重音或特殊caracteres的文本。我在Controller MVC中创建它,然后发送到viewbag查看。

By the way, my text html (when I use browser's view HTML sourcecode) is getting with a different code.
Example:
orign text: Produtor's Event em 10 Kirkpatrick St, até N...
html text: Produtor's Event em 10 Kirkpatrick St, at&#233...

顺便说一下,我的文本html(当我使用浏览器的视图HTML源代码时)得到了不同的代码。示例:orign text:Produtor's Event em 10 Kirkpatrick St,atéN... html text:Produtor's event em 10 Kirkpatrick St,até ...

I need to care about this? Or I need to correct to a new code? How can I?

我需要关心这件事吗?或者我需要更正新代码?我怎么能够?

1 个解决方案

#1


0  

The solution is easier.

解决方案更容易。

Use @Html.Raw

<meta name="description" content="@Html.Raw(ViewBag.description)" />

#1


0  

The solution is easier.

解决方案更容易。

Use @Html.Raw

<meta name="description" content="@Html.Raw(ViewBag.description)" />