asp.net mvc - pass data from controller to view -


i know there many ways it. want pass cerq text view. want see cerq in div. not want see div tags instead want browser interpret it.

this function in controller

    public actionresult index()     {           viewdata["cerq"] = "<div>baha</div>";           return view();     } 

and view part

@{     viewbag.title = "abc";     layout = "~/views/common/_layout.cshtml"; }  <h2>menudene  - @viewdata["cerq"] - </h2> 

what should do?

in view wrote

@html.raw(viewdata["cerq"]) 

and solves.


Comments

Popular posts from this blog

c++ - End of file on pipe magic during open -

basic authentication with http post params android -

data.table making a copy of table in R -