How does Html.Raw MVC helper work?
Because encoded characters are HTML, and the Raw version of that string is the encoded one. Html.Raw renders what it is given without doing any html encoding, so with ViewBag.div = “<div> Hello </div>”;: @Html.Raw(ViewBag.div); Renders <div> Hello </div> However, when you have encoded characters in there, such as ViewBag.Something = “>”; the raw version … Read more