Cross-Page PostBack error when posted from one folder to another
<p>I'm getting the 'Object reference not set to an instance of an object.' error on PreviousPage after using PostBackUrl.</p>

<p>I created a simple test page to recreate the problem, however it worked fine, until I moved the source and destination pages into different folders. Is this the reason the PreviousPage object is null? how do I fix it?</p>

<p>Both the folders the source and destination pages are in are in the root directory of the website.</p>

<p>Source Page: /companies/test.aspx</p>

<pre><code>&lt;asp:Content runat="server" ID="Content" ContentPlaceHolderID="FullPage"&gt;
    &lt;asp:TextBox ID="Demo" runat="server"&gt;&lt;/asp:TextBox&gt;
    &lt;asp:LinkButton ID="testlink" Text="test" runat="server"  PostBackUrl="~/Documents/test2.aspx"&gt;
    TESTING
    &lt;/asp:LinkButton&gt;
&lt;/asp:Content&gt;

public string MyVariable
{
    get
    {
        return Demo.Text;
    }
}
</code></pre>

<p>Destination Page: /documents/test2.aspx</p>

<pre><code>&lt;%@ PreviousPageType VirtualPath="~/Companies/test.aspx"  %&gt; 

&lt;asp:Content runat="server" ID="Content" ContentPlaceHolderID="FullPage"&gt;
    &lt;asp:Label ID="output" runat="server" /&gt;
&lt;/asp:Content&gt;

protected void Page_Load(object sender, EventArgs e)
{
    string MyText = PreviousPage.MyVariable;
    output.Text = MyText;
}
</code></pre>
