简体   繁体   中英

Html to Formatted Text C#

I have a column on my table (SQL Server 2014).
Which contains, like <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>

It shows as is. I want to display it with formatted Html base on the content of my data.
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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM