asp.net mvc - Links not displaying properly in ASP MVC3 razor view -
i've implemented solution explained in post how tweet's html linqtotwitter? when display tweets html links appear this
<a class="inline" href="http://twitter.com/cgitosh" target="_blank">@cgitosh</a> , how you?
instead of showing @cgitosh , how you? @cgitosh linking twitter account.
what i'm not doing right?
razor code snipet:
@{var tweet = twitterextensions.text2html(item.text);} <div>@tweet</div>
so pass tweet text text2html function explained in link provided above returns tweet links variable tweet output in view
try:
@{var tweet = twitterextensions.text2html(item.text);} <div>@(new htmlstring(tweet))</div>
...and unless you're using tweet elsewhere, do
<div>@(new htmlstring(twitterextensions.text2html(item.text)))</div>
razor default html encodes strings, have explicitly tell render markup. (see here.) hope helps!
Comments
Post a Comment