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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -