Make Server.Transfer Postback

K

kaburke

Is there a way to make a page at the receiving end of a Server.Transfer
think that the request is a Postback? (When I say "think it is a Postback,"
I mean I want the page to go through the ENTIRE event sequence for a
postback, including LoadViewState, ProcessPostData, etc.) Even when
Sever.Transfer transfers a page to itself (i.e., Page A.aspx contains
Server.Transfer("A.apsx")) the request is seen as a first-time request, not
a Postback. Is there some way to fool/force the page into thinking the
request is a Postback and run through the entire event gambit, whether it is
from the same page or not?

To answer the inevitable question, "Why?" I have the following flow in my
application:

a.apsx -> b.aspx -> a.aspx

where b.aspx Server.Transfers to a.aspx. Upon return to a.aspx, I want the
form to pick up where it left off, so that the little side trip to b.aspx
doesn't interrupt the user experience.

Thanks,
--kaburke
 
K

kaburke

Alternatively, is there some way to force execution of the entire event
sequence (LoadViewState, ProcessPostData, etc.) even when the request is not
a Postback?

Thanks,
--kaburke
 
J

John Timney \(ASP.NET MVP\)

why dont you just server.execute page b passing the data it needs to b, that
way page a will wait for page b to complete

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
K

kaburke

Page b.aspx requires user interaction, so doesn't Server.Execute end up (in
this situation) behaving like Server.Transfer (i.e., isn't execution of
a.aspx ended when b.aspx is returned to client)?

Thanks,
--kaburke
 
K

kaburke

The same window.

Thanks,
--kaburke

Eliyahu Goldin said:
Do you want b.aspx to run in the same browser window or in a different
one?
In the latter case you could start another window on client side without
any
postback in a.aspx.

Eliyahu
 
G

Guest

by stating "want the form to pick up where it left off" , i believe you are
looking for the data user entered in the first visit to a.aspx to be
displayed and any changes made to values of controls at server side to be
reflected.

Other than using b.aspx in a popup, do not know of any other default method
supported by asp.net/browser to handle this..

if content of a.aspx and b.aspx is simple, you may try using ASP:pANELs

One way to handle transfering data back and forth between multiple forms is
to use a transaction table in database.
 
E

Eliyahu Goldin

Do you want b.aspx to run in the same browser window or in a different one?
In the latter case you could start another window on client side without any
postback in a.aspx.

Eliyahu
 

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,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top