c# - Cross-Page PostBack error when posted from one folder to another -


i'm getting 'object reference not set instance of object.' error on previouspage after using postbackurl.

i created simple test page recreate problem, worked fine, until moved source , destination pages different folders. reason previouspage object null? how fix it?

both folders source , destination pages in in root directory of website.

source page: /companies/test.aspx

<asp:content runat="server" id="content" contentplaceholderid="fullpage">     <asp:textbox id="demo" runat="server"></asp:textbox>     <asp:linkbutton id="testlink" text="test" runat="server"  postbackurl="~/documents/test2.aspx">     testing     </asp:linkbutton> </asp:content>  public string myvariable {         {         return demo.text;     } } 

destination page: /documents/test2.aspx

<%@ previouspagetype virtualpath="~/companies/test.aspx"  %>   <asp:content runat="server" id="content" contentplaceholderid="fullpage">     <asp:label id="output" runat="server" /> </asp:content>  protected void page_load(object sender, eventargs e) {     string mytext = previouspage.myvariable;     output.text = mytext; } 

solved: problem in casing of postbackurl , actual directory structure.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -