Problem with Server.Transfer

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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?
 
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
 
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?
 
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,
 
Back
Top