Actual html markup not html entity when inserted f

2019-04-23 17:15发布

问题:

It probably isn't mvc3 specific but when I insert a property in my razor view

@Model.description

containing html markup

P><STRONG>ASSOCIATE MEMBERSHIP</STRONG><BR><BR>Individuals who are interested in being involved with the SWPRG by submitting photo's, investigation reports, attending monthly meetings, leads, stories and talking to our On-Site Team Members about cases and other issues. <BR><STRONG><EM>BENEFITS INCLUDE:</EM></STRONG><BR>-

the browser renders the html with HTML Entities

lt;P&gt;&lt;STRONG&gt;ASSOCIATE MEMBERSHIP&lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;Individuals who are interested in being involv

How do I inject the HTML to be rendered as HTML?

@HTML.??(@Model.description);

回答1:

 @Html.Raw( Model.description );