Wednesday, August 27, 2014

IHtmlString!

Make one like so:

public ActionResult Whatever()
{
   IHtmlString html = new HtmlString("<strong>I'm yelling!</strong>");
   return View(html);
}

 
 

Use what you just made like this:

@model IHtmlString
@{
   Layout = null;
}
<html>
   <head>
      <title>Whatever</title>
   </head>
   <body>
      @Html.Raw(Model)
   </body>
</html>

No comments:

Post a Comment