[英]Html to Formatted Text C#
I have a column on my table (SQL Server 2014).我的桌子上有一列(SQL Server 2014)。
Which contains, like <p><strong>Content</strong></p>
其中包含,如
<p><strong>Content</strong></p>
I want to display it on my Table View, currently I'm using MVC 5. Normally, I just need to add <td>@Html.DisplayFor(model => item.Content)</td>
我想在我的表格视图上显示它,目前我正在使用 MVC 5。通常,我只需要添加
<td>@Html.DisplayFor(model => item.Content)</td>
It shows as is.它按原样显示。 I want to display it with formatted Html base on the content of my data.
我想根据我的数据内容用格式化的 Html 显示它。
Please help.请帮忙。 Thank you.
谢谢你。
I think what you're looking for is我想你要找的是
@Html.Raw(Model.Content)
I just give up too early.我只是放弃得太早了。 I got the answer.
我得到了答案。
@Html.Raw(item.Content)
Thank you.谢谢你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.