title: ASP.NET Custom Control - Unknown server tag
body: <p>I've made a custom control that inherits from a Literal control. When I try and use my control on a page a parsing error is thrown. I've added this to my web.config</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;system.web&gt;
      &lt;pages&gt;
        &lt;controls&gt;
          &lt;add tagPrefix="one" namespace="myApplication.Controls"/&gt;
        &lt;/controls&gt;
      &lt;/pages&gt;
    &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>And I've added this to my page</p>
  
  <pre><code>&lt;%@ register namespace="myApplication.Controls" tagprefix="one" %&gt;
  </code></pre>
  
  <p>Neither of these have fixed the issue. I have a external assembly with some custom controls that work just fine within my project. As a workaround, I'm considering moving my custom control into the external library if there's no simple solution.</p>
  
  <p>--edit </p>
  
  <p>Here's the page code.</p>
  
  <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SignUp.ascx.cs" Inherits="myApplication.Controls.SignUp" %&gt;
  &lt;%@ register namespace="myApplication.Controls" tagprefix="one" %&gt;
  &lt;div class="in"&gt;
      &lt;span&gt;      
          &lt;one:resourceliteral id="lblFirstname" runat="server" resourcekey="FirstName" resourceresolver="ResourceStringResolver.GetResourceString"&gt;
          &lt;/one:resourceliteral&gt;      
          &lt;/span&gt;
      &lt;div&gt;
          &lt;pl:textbox id="txtFirstName" runat="server"&gt;&lt;/pl:textbox&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And here's the code for my actual control</p>
  
  <pre><code>namespace myApplication.Controls
  {
      public class ResourceLiteral : Literal
      {
          private ResourceManager rm;
  
          public delegate string dResourceResolver( string label, eLanguage language );
  
          public event dResourceResolver ResourceResolver;
  
          public string ResourceKey { get; set; }
          public object DataSource { get; set; }
  
          private eLanguage _Language = eLanguage.ENUS;
          public eLanguage Language
          {
              get { return _Language; }
              set { _Language = value; }
          }
  
          protected override void OnLoad(EventArgs e)
          {
              base.OnLoad(e);
  
              if (ResourceResolver != null)
                  Text = ResourceResolver.Invoke( ResourceKey, _Language );
              else
              {
                  if(rm != null)
                  {
                      Text = rm.GetString( ResourceKey );
                  }
              }
          }
  
          public void LoadDataSource(string resource)
          {
              rm = new ResourceManager( resource, Assembly.GetExecutingAssembly() );
          }
  
          public void LoadDataSource(Type resource)
          {
              rm = new ResourceManager( resource );
          }
      }
  }
  </code></pre>