Display encoded html with razor

前端 未结 6 1710
心在旅途
心在旅途 2020-12-02 10:13

I store encoded HTML in the database.

The only way i could display it correctly is :

@MvcHtmlString.Create(HttpU
6条回答
  •  猫巷女王i
    2020-12-02 11:06

    Use Html.Raw(). Phil Haack posted a nice syntax guide at http://haacked.com/archive/2011/01/06/razor-syntax-quick-reference.aspx.

    @Html.Raw( Model.Content )

提交回复
热议问题