Cross-Page Posting a GridView
<p>I have a problem with Cross-Page Posting a GridView.</p>

<p>The error I'm getting is the following:
<strong>Object reference not set to an instance of an object.</strong></p>

<p>Steps I took:</p>

<ol>
<li>Create the new Page and add a GridView</li>
<li><p>Create a button with PostBack to the new page.</p>

<pre><code>&lt;asp:Button ID="Button1" Text="Button 1" PostBackUrl="~/Page2.aspx?button=1" runat="server" /&gt;
</code></pre></li>
<li><p>Adding code behind to the new Page.</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{
   if (Page.PreviousPage == null)
   {
      Label1.Text = "Vul een planing in.";
   }
   else
   {
      ContentPlaceHolder pageContent =
          (ContentPlaceHolder)(Page.PreviousPage.FindControl("Content1"));
      GridView1.DataSource = pageContent.FindControl("GridView2"); // In this line I'm getting the error
   }
}
</code></pre></li>
</ol>

<p>Looking at the error I forgot a reference. Thnx for the help:)</p>
