[英]Html.DisplayFor shows tags as plain text
Presuming your Description property value contains HTML tags (the <span>
): 假设您的Description属性值包含HTML标记(
<span>
):
You want @Html.Raw(Model.Description)
. 您需要
@Html.Raw(Model.Description)
。 @Html.DisplayFor
will automatically delimit HTML to prevent HTML injection. @Html.DisplayFor
将自动分隔HTML以防止HTML注入。 If your expecting HMTL output use Raw()
如果您期望的HMTL输出使用
Raw()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.