title: Wrong usage of MVC @helper?
body: <p>I made a helper which is meant to help me debug my app.</p>
  
  <p>It firsts display a header.
  Then it tries to run a block of code which returns a fews arguments (array of objects).
  Those arguments are used in a string format which is displayed when the block ran fine.
  If the block caused an exception, the exception gets displayed.</p>
  
  <p>The problem is, nothing gets displayed at all when I call the helper (I'm very new to that feature).</p>
  
  <p>What's wrong?</p>
  
  <pre><code>@{
      Layout = "~/Views/Shared/_Layout.cshtml";
  }
  
  @using MygLogWeb.Classes.Fox
  
  &lt;span&gt;test&lt;/span&gt;
  
  @helper TryMethod(
      string header
      , Func&lt;object[]&gt; act
      , string successFormat
  )
  {
      @Html.Raw(String.Format(
          @"&lt;h2&gt;{0}&lt;/h2&gt;"
          , HttpUtility.HtmlEncode(header)
      ));
  
      try
      {
          var args = act();
  
          if (successFormat == null)
          {
              @Html.Raw(@"&lt;span class='Success'&gt;OK&lt;/span&gt;");
          }
          else
          {
              @Html.Raw(String.Format(
                  @"&lt;span class='Success'&gt;{0}&lt;/span&gt;"
                  , HttpUtility.HtmlEncode(String.Format(
                      successFormat
                      , args
                  ))
              ));
          }
      }
      catch (Exception exe)
      {
          @Html.Raw(String.Format(
              @"&lt;span class='Error'&gt;{0}&lt;/span&gt;"
              , HttpUtility.HtmlEncode(exe.Message)
          ));
      }
  }
  
  &lt;span&gt;test&lt;/span&gt;
  
  @{
      TryMethod(
          "Cust.Columns"
          , () =&gt; {
              return new object[]
              {
                  Cust.Columns.Count
              };
          }
          , "Count: {0}"
      );
  }
  
  &lt;span&gt;test&lt;/span&gt;
  </code></pre>