title: Custom namespace for code behind .aspx page
body: <p>I am using .NET2.0. Let's say a have a simple aspx form with txtInput and btnSomeAction</p>
  
  <pre><code>   &lt;asp:TextBox ID="txtInput" runat="server"&gt;&lt;/asp:TextBox&gt;
     &lt;asp:Button ID="btnSomeAction" runat="server" CommandName="SomeAction" Text="Do"/&gt;
  </code></pre>
  
  <p>Then within the code behind the form I have</p>
  
  <pre><code>Protected Sub btnSomeAction_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSomeAction.Click
      Dim s As String
      s = txtInput.Text
  End Sub
  </code></pre>
  
  <p>It all works fine.</p>
  
  <p>Then I want to add the code to a custom namespace like</p>
  
  <pre><code>Namespace mycustomnamespace
  </code></pre>
  
  <p>When doing that I would get a complier error:</p>
  
  <p><strong><em>Name 'txtInput' is not declared</em></strong>  - as if the code was no longer connected to the page</p>
  
  <p>Do i need to modify the aspx page to include the namespace?, What about the partial class?</p>