Monday, February 6, 2012

Html Raw of MVC 3 with Razor view engine

Today, I'm posting about HTML Raw of MVC3 Razor View engine.

HtmlString IHtmlString and HttpUtlity.HtmlEncode in ASP.NET 4 are fantastic features.

Saving Content in Database, retrieve it dynamically on Front end page that is absolutely nice.

HtmlHelper.Raw Method wraps HTML markup using the IHtmlString class, which renders unencoded HTML.

   1:  public IHtmlString Raw(
2: string value 3: )

   1:  @{ var para = "<p>I am a parargraph</p>";}
   2:  @Html.Raw(para)

No comments: