Razor - HTML.RAW does not output text

前端 未结 5 1567
情话喂你
情话喂你 2020-12-09 14:45

I have tried all solution proposed to other, similar questions but none of them seems to work. In essence I am trying to display a table filled with data from collection of

5条回答
  •  情话喂你
    2020-12-09 15:38

    Html.Raw

    Wraps HTML markup in an HtmlString instance so that it is interpreted as HTML markup. For Example :

    Controller

    public actionresult Htmlraw()
    {
        viewbag.message = "Hey friends lets go" + "
    " + "for chillout"; return view(); }

    output

    @html.raw(viewbag.message);
    

提交回复
热议问题