If you have html line breaks, links or other HTML tags that you’d like to use in a ViewBag, it’s not as hard as it seems. At first I tried Html.Encode/Decode, but that didn’t work. It seemed like the things I tried just kept adding to a list of items that proved you couldn’t do it.
But then I found that it wasn’t hard after all.
just use HTML Raw:
All Things DotNet Discussed – Winforms/ASP.Net/SharePoint/WPF