Problem with Server.Transfer

G

Guest

I have an app that uses Server.Transfer from page1 to page2. page2 needs to be able to read all the values from page1's form. The problem is, if the user clicks the back button on page2 after a Server.Transfer, the user gets a page has expired error.

Is there a way to keep using Server.Transfer, but also have the back button work normally?
 
P

Peter Rilling

Although I have not used Transfer very much, I would imagine not. The
reason being that the back button is controlled by the browser and when you
call Transfer, the browser does not know that you are changing pages, all
the work is done on the server. So, as far as the browser is concerned, you
are still on page1, regardless of how many calls to Transfer you make.

Someone can correct me if I am wrong. Would not be the first time. :p

john said:
I have an app that uses Server.Transfer from page1 to page2. page2 needs
to be able to read all the values from page1's form. The problem is, if the
user clicks the back button on page2 after a Server.Transfer, the user gets
a page has expired error.
Is there a way to keep using Server.Transfer, but also have the back
button work normally?
 
D

DalePres

I use Server.Transfer extensively in the app I am working on now and I don't
have any problems with the back button. It's hard to say what I'm doing
differently from what you're doing, or vice versa, but that at least shows
that you can use the back button without having to refresh the page.

Peter, you're right about one thing. When the second page is loaded from
Server.Transfer, the browser address bar still shows the first page address
but after posting back via any control or submitting the form, then the
address bar shows the address for the second page.

Hope that helps some, John. At least you know it's possible.

Dale
 
C

Charlie@CBFC

Selecting history buttons just pull dead pages from cache, they do not
request new page from server so no code runs.

Charlie
john said:
I have an app that uses Server.Transfer from page1 to page2. page2 needs
to be able to read all the values from page1's form. The problem is, if the
user clicks the back button on page2 after a Server.Transfer, the user gets
a page has expired error.
Is there a way to keep using Server.Transfer, but also have the back
button work normally?
 
J

Joerg Jooss

Charlie@CBFC said:
Selecting history buttons just pull dead pages from cache, they do not
request new page from server so no code runs.

Careful... that depends
a) on the browser,
b) on the page's cache settings.

Cheers,
 

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

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top