title: How to register custom server control on ASP.NET page
body: <p>I have a project and I am trying to register a custom server control (there is no <code>.ascx</code> file) on the page.  I am currently using </p>
  
  <h2>Class Declaration</h2>
  
  <pre><code>namespace MyApp.Controls{
      public class CustomControl: WebControl{
          public string Text
          {
              get
              {
                  String s = (String)ViewState["Text"];
                  return ((s == null) ? String.Empty : s);
              }
              set
              {
                  ViewState["Text"] = value;
              }
          }        
          protected override void RenderContents(HtmlTextWriter output)
          {
              output.Write(Text);
          }
      }
  }
  </code></pre>
  
  <p>On my page,</p>
  
  <pre><code>&lt;%@ Register TagPrefix="myControls" Namespace="MyApp.Controls" %&gt;
  &lt;myControls:CustomControl runat="server" Text="What up!" /&gt;
  </code></pre>
  
  <p>I receive a Parser Error, with the message <strong>"Unknown server tag 'myControls:CustomControl'."</strong></p>
  
  <p>What am I doing wrong?</p>