开发者

asp.net mvc - show content from string with html

开发者 https://www.devze.com 2023-01-18 01:09 出处:网络
in my Model I have a string property Feeds with value like that: <img src=\"/Images/Company/twitter.png\" style=\"border:0; vertical-align:text-bottom;\"/>

in my Model I have a string property Feeds with value like that:

<img src="/Images/Company/twitter.png" style="border:0; vertical-align:text-bottom;"/>
&nbsp;
<b>
    9/29/2010 1:01:33 PM
</b>
<br/>
How to get started building rich #VS2010 #VSPackage based extensions - 
<a href="http://bit.ly/a8ksc1" target="_NEW">
    http://bit.ly/a8ksc1
</a>
<br/>&nbsp;<br/>
<img src="/Images/Company/twitter.png" style="border:0; vertical-align:text-bottom;"/>
&nbsp;
<b>    
    9/3/2010 9:51:26 AM
</b>
<br/>
Windows Phone 7 – Released To Manufacturing 
<a href="http://bit.ly/a7HHvw" target="_NEW">
    http://bit.ly/a7HHvw
</a>
<br/>&nbsp;<br/><br/>
<img src="/Images/Company//rss.png" style="border:0; vertical-align:text-bottom;"/>
&nbsp;RSS feed to busy :-(
<br/>

How can I show it like html开发者_开发知识库 in my view?? I can get it out in textArea, but i want to just to show it like html.

<%= Html.TextAreaFor(obj => obj.Feeds, 60, 40, null) %>


<%= Model.Feeds %>


you can use

<%=Html.Encode(Model.Feeds)%>

this will encode ur tags to html equivalent codes and they will not be interpreted when rendering them on the web page.

0

精彩评论

暂无评论...
验证码 换一张
取 消