Problem Using PreviousPage

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.
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,814
Latest member
SpicetreeDigital

Latest Threads

Top