Problem Using PreviousPage

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

I have two pages, named receipt.aspx and checkoutform.aspx. My
checkoutform.aspx page has an orderid property and uses a
Response.Redirect("receipt.aspx") to send the user to to receipt.aspx. My
receipt.aspx page has the following directive:

<%@ PreviousPageType VirtualPath="~/checkoutform.aspx" %>

But when I use the following expression:

Me.PreviousPage.orderid

I recieve an Object is not set to an instance of an object error. What am I
forgetting? Thanks.
 
PreviousPage only works with a ServerTransfer. this is because with a
transfer, the new page instance is created by old instance, so they both
exist at the same time.

with a redirect, the last page instance no longer exists, as it was
destroyed after the response was sent to the browser.

-- bruce (sqlwork.com)
 
Back
Top