title: FindControls<T> Extension Method - What am I missing?
body: <p>I am trying to add an extension method to allow me to easily get a List of various different control types on a web forms ASP.Net page. I have created a new static class and inserted the extension method:</p>
  
  <pre><code>public static class PageExtension
  {
      public static IEnumerable&lt;T&gt; FindControls&lt;T&gt;(this Page page, bool recurse) where T : Control
      {
          List&lt;T&gt; found = new List&lt;T&gt;();
          Action&lt;Control&gt; search = null;
          search = ctrl =&gt;
          {
              foreach (Control child in ctrl.Controls)
              {
                  if (typeof(T).IsAssignableFrom(child.GetType()))
                  {
                      found.Add((T)child);
                  }
                  if (recurse)
                  {
                      search(child);
                  }
              }
          };
          search(control);
          return found;
      }
  }
  </code></pre>
  
  <p>Now I want to call the method from my page, so I added this:</p>
  
  <pre><code>    protected void ResetControls()
      {
          var listTextBox = this.Page.FindControls&lt;TextBox&gt;(true);
      }
  </code></pre>
  
  <p>However I get the compile error:</p>
  
  <p>'System.Web.UI.Page' does not contain a definition for 'FindControls' and no extension method 'FindControls' accepting a first argument of type 'System.Web.UI.Page' could be found</p>
  
  <p>I am using Master Pages if that makes any difference, but what am I missing here?</p>
  
  <p>Thank you!</p>