How to tell razor NOT to html escape

后端 未结 1 671
傲寒
傲寒 2021-02-03 17:25

I am using asp.net mvc 3 with razor for a project. At some I need to serialize an array from the controller, put it in the viewdata and assign it to a js object. However when I

1条回答
  •  清歌不尽
    2021-02-03 18:09

    You need to output an instance of the new IHtmlString interface, which contains pre-escaped HTML.

    To do that write @Html.Raw(...).

    0 讨论(0)
提交回复
热议问题