I have a controller which generate string containing html markups.Now when I am displaying it on views, it is displayed as simple string containing all tags. I tried to u
You are close you want to use @Html.Raw(str)
@Html.Raw(str)
@Html.Encode takes strings and ensures that all the special characters are handled properly. These include characters like spaces.
@Html.Encode