Reputation: 3158
I have some html stored in a table. here is some sample data
<p><span style="font-size: small; color: #ff0000;"><span style="font-size: small;">&nbsp;<span style="font-size: large; color: #000000;">ਮਾਂ</span><br />&nbsp; <br />ਚਾਵਾਂ ਸਧਰਾਂ ਦੇ ਨਾਲ ਮਾਏ ਜੋ ਤੂੰ ਬੂਟਾ ਲਾਇਆ,<br />ਦੇ ਮਮਤਾ ਦਾ ਪਾਣੀ ਅੱਜ ਓਹ ਭਰ ਜੋਬਨ ਤੇ ਆਇਆ,<br />
I am trying to display on page, I am using asp.net mvc razor view and using
@Html.Raw(blog.Body)
but its not working. can someone help, what is the reason.
Thanks
Parminder
Upvotes: 24
Views: 31934
Reputation: 9242
kindly try this:
@Html.Raw(HttpUtility.HtmlDecode(blog.Body));
and let me know if it worked.
Upvotes: 57