Display string as html in asp.net mvc view

后端 未结 5 1734
北恋
北恋 2020-12-01 04:22

I have a controller which generate string containing html markups.Now when I am displaying it on views, it is displayed as simple string containing all tags. I tried to u

5条回答
  •  温柔的废话
    2020-12-01 04:51

    you can use @Html.Raw(str)

    See MSDN for more

    Returns markup that is not HTML encoded.

    This method wraps HTML markup using the IHtmlString class, which renders unencoded HTML.

提交回复
热议问题