title: NullReferenceException exception raising on a content page which is referenced through an assembly
body: <p>I'm having this issue when trying to use an ASPX page from a referenced assembly. This page consists of a content page and its master page. The exception only raises when any of the content page webcontrols are accessed from another web project, but that doesn't happen when that page is visited from the same project it belongs to. </p>
  
  <p>At first, this pages were supposed to be regular ASPX pages, and then they worked great (ie this exception didn't happen), but our higher-ups decided to wrap them into MasterPages for some reusability sake or something (which is kinda odd since this ASPX pages are autogenerated).</p>
  
  <p>So, we got into this trouble now : /</p>
  
  <p>EDIT:
  I'm adding some code to help you to help me :)</p>
  
  <p>Master Page:</p>
  
  <pre><code>&lt;%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPage.master.cs"
  Inherits="WebApplicationTemplate.MasterPage" %&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head id="Head1" runat="server"&gt;
      &lt;asp:ContentPlaceHolder ID="headPlaceHolder" runat="server"&gt;
      &lt;/asp:ContentPlaceHolder&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form" runat="server"&gt;
          &lt;asp:ContentPlaceHolder ID="formPlaceHolder" runat="server"&gt;
          &lt;/asp:ContentPlaceHolder&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Content Page:</p>
  
  <pre><code>&lt;%@ MasterType VirtualPath="~/MasterPage.Master" %&gt;
  
  &lt;%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
      CodeBehind="TestPage.aspx.cs" Inherits="WebApplicationTemplate.TestPage" %&gt;
  
  &lt;asp:Content ID="headContent" ContentPlaceHolderID="headPlaceHolder" runat="server"&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="formContent" ContentPlaceHolderID="formPlaceHolder" runat="server"&gt;
      &lt;asp:TextBox ID="id1" runat="server" Text="Text" MaxLength="40" Style="top: 100;
          left: 100; width: 100; height: 100; position: absolute;" /&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>Function that raises the exception in the content page code behind:</p>
  
  <pre><code>public void Foo()
  {
  id1.Text = "something"; //Object reference not set to an instance of an object.
  }
  </code></pre>
  
  <p>As I said before, I only got this problem when I access this page from another project through a referenced assembly.
  I don't know if I have to configure something in any web.config, whether in the Master page project or the one which references the assembly of the former project.</p>