title: Can ASPX pages share code behind file?
body: <p>Let say I have two ASPX pages with identical server-side controls. </p>
  
  <pre><code>~/TemplateA/Contact.aspx
  ~/TemplateB/Contact.aspx
  </code></pre>
  
  <p>By default, they are mapped to their respective code-behind file.</p>
  
  <pre><code>~/TemplateA/Contact.aspx.cs
  ~/TemplateB/Contact.aspx.cs
  </code></pre>
  
  <p>Instead, I would like them to point to a single, common code-behind file, as</p>
  
  <pre><code>~/Classes/Contact.aspx.cs
  </code></pre>
  
  <p>I already have them inheriting from a base "Contact" function class, who exposes the whole business-logic, but I still can't figure how to refer the server-side controls of the pages into the base "Contact" class; as example, I would like to be able to write:</p>
  
  <pre><code>this.textBox1.Text = "Hello"
  </code></pre>
  
  <p>in my base class instead of writing it in each single .cs file.
  Obviously, "textBox1" isn't a known object in my base class as it has no designer file attached.</p>
  
  <p>Is it possible? </p>