title: Custom HTML helper class in MVC
body: <p>I've been using custom HTML helper extensions for some time now. Lately I've decided it would be nice to use helper that look like this</p>
  
  <pre><code>&lt;%: Style.MyCustomExtensionMethod(...) %&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>@Style.MyCustomExtensionMethod("abcd")
  </code></pre>
  
  <p>I searched all over the net but always ran into custom HTML helpers that are called via <code>Html.</code></p>
  
  <p>I also inherited from HtmlHelper class like this</p>
  
  <pre><code>public static class Style : HtmlHelper
  {
      public static string test(this HtmlHelper helper, string text)
      {
          return text;
      }
  }
  </code></pre>
  
  <p>but that didn't work (in the View it says it cannot find method test() that takes one parameter.</p>