store and display html tags in MVC

后端 未结 1 418
北荒
北荒 2021-01-21 22:00

How can I store post.content as html in database and how can I display with rendered html without tags. I am trying with following way, but it\'s not working. It can stored enco

相关标签:
1条回答
  • 2021-01-21 22:47

    MVC3/Razor:

    @Html.Raw(item.Content)
    

    MVC2/WebForms:

    <%: MvcHtmlString.Create(item.Content) %>
    
    0 讨论(0)
提交回复
热议问题