title: Html.Raw is null
body: <p>I'm in trouble here. In my view i have the following code:</p>
  
  <pre><code>@if (!string.IsNullOrEmpty(alert)) { 
      &lt;div class="alert"&gt;@Html.Raw(alert)&lt;/div&gt;
  }
  </code></pre>
  
  <p>But an exception of type <code>NullReferenceException</code> is being thrown saying that the Html property is null. How i can solve this?</p>
  
  <p>OBS: My view page inherits from a class that by their turn inherits from <code>System.Web.WebPages.WebPage</code></p>
  
  <p>// WEBCONFIG</p>
  
  <pre><code>&lt;system.web&gt;
  &lt;compilation debug="true" targetFramework="4.0"&gt;
    &lt;assemblies&gt;
      &lt;add assembly="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
      &lt;add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
      &lt;add assembly="System.Web.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
      &lt;add assembly="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
      &lt;add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
      &lt;add assembly="System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
    &lt;/assemblies&gt;
  &lt;/compilation&gt;
  &lt;httpRuntime targetFramework="4.0"/&gt;
  </code></pre>
  
  <p></p>