title: How to import URLExtension so its available to all Views & Ascx (Asp.NET MVC 2)
body: <p>I am using a extension class for pulling images, css, scripts etc. </p>
  
  <p>In the UI layer, I have Master Pages, Views (aspx) and Partial Views (ascx). Is it required to Import <code>&lt;%@ Import Namespace="Resorts.Web.Helpers" %&gt;</code> inside each Master, View &amp; Ascx? If I import inside Master, why can't my Views &amp; Ascx automatically know about it? Am I doing it wrong way?</p>
  
  <pre><code>namespace Resorts.Web.Helpers
  {
      public static class UrlHelperExtension
      {
          public static string Image(this UrlHelper helper, string fileName)
          {
              return helper.Content("~/Content/Images/" + fileName);
          }
  
          public static string Stylesheet(this UrlHelper helper, string fileName)
          {
              return helper.Content("~/Content/CSS/" + fileName);
          }
  
          public static string Script(this UrlHelper helper, string fileName)
          {
              return helper.Content("~/Scripts/" + fileName);
          }
  
      }
  }
  </code></pre>