Displaying HTML String from Model in MVC Razor View

前端 未结 4 471
星月不相逢
星月不相逢 2021-01-12 01:43

I have a Model filed that returns an HTML string with line break BR tag, but How do I display that HTML on the browser ? The problem ins instead putting the line break, the

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-12 02:18

    You can just omit both DisplayFor and modelItem =>, so:

    @Html.Raw(item.Speaking)
    

提交回复
热议问题