473,473 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Redirect to multiple pages without displaying each page...

Hi all :-)

I need to redirect to multiple pages on click of a transmit button, without
redisplaying each page. This redirection is to capture session variables
that are created on each page and pass them to the main page to be
displayed. We are actually NOT using session variables, but storing the
values in a temporary table. The problem is that the values don't get
stored in the temporary table unless the user goes to each page individually
to view it, and then goes to the "Summary" page where all the values are
displayed. If the user does not go to each page first, the values won't
appear in the summary. I need a way to cycle through those pages behind the
scene, with out the user having to view each page individually. Can any one
help me with a suggestion or example on how to do this? Any help is much
appreciated.

Thanks,

Coleen
Nov 21 '05 #1
6 5783
Hello...

I would probably try Server.Transfer or Response.Redirect and on the
page load have it call what needs to be done and move to the next page.

If the pages are used by others possibly pass a flag in the query
string or form values etc...to distinguish that the page is to be
redirected.

Marc Cramer

Nov 21 '05 #2
Actually, Marc, we are using the response.redirect, but how do you make the
page that is called not display, and close it after the values are passed?
We don't want the users to have to "look" at the page if they go directly to
the summary page without checking all the pages that do the calculations
first. Dumb question, but what exactly is a Server.Transfer event, and how
does it work? I've never used that before...

Thanks for your help!

Coleen

"Marc Cramer" <cr*******@comcast.net> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Hello...

I would probably try Server.Transfer or Response.Redirect and on the
page load have it call what needs to be done and move to the next page.

If the pages are used by others possibly pass a flag in the query
string or form values etc...to distinguish that the page is to be
redirected.

Marc Cramer

Nov 21 '05 #3
Hello...

Not a dumb question at all.

quoted from msdn help
"You may want to redirect users from one Web Forms page to another
page. You might do this to display a page that is matched to the user's
browser capabilities or is written in the language that the user
speaks.

There are two ways to redirect pages:

Using a server-side method. In this scenario, the server simply
transfers the context to another page. The advantage is that you can
share page context information between pages. The disadvantage is that
the user's browser does not know about the transfer, so the browser's
history is not updated. If the user refreshes the page, unexpected
results can occur.

Using the browser. In this scenario, you send a command to the user's
browser that causes the browser to fetch a different page. The
advantage is that the browser's history is updated. The disadvantage is
that this scenario performs an extra round trip, which can affect
performance."
From my experience using Server.Transfer you can pass the form

submission from page to page but the URL displayed in the browser is
not changed to reflect the page they were transferred to, while with
Response.Redirect you have to handle the form submission on each page
or it is lost, but the URL is updated to reflect where they are...

Just a reminder:
if using cookies the values to be stored are not set on the client
until the page has been sent...
so could run into problems if transfer, set value, transfer and try to
read value prior to page postback
This happens because the client cookie hasn't been updated yet since
the page hasn't gone to the client and updated the cookie

I suggest trying the Server.Transfer() to go page to page but on the
page that is immediately prior to your final page do a
Response.Redirect so that the URL matches and if they press back in the
browser they will be taken to the original starting page.
Make sense?

Marc

Nov 21 '05 #4
Hello,

Sorry I missed the first question about not displaying the page...
try something like this

C#
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
if(Page.IsPostBack==false)
{
// check to see if we have our flag to indicate auto redirect...
if(Request.QueryString["Flag"]!=null)
{
// call the processing methods here...
DoStuff();
// go to next page...
Response.Redirect("NextPage.aspx", true);
}
// we got here so handle as a normal diplayed page...

}
}

VB.NET
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Page.IsPostBack = False Then
' check to see if we have our flag to indicate auto redirect...
If Not Request.QueryString("Flag") Is Nothing Then
' call the processing methods here...
DoStuff()
' go to next page...
Response.Redirect("NextPage.aspx", True)
End If
' we got here so handle as a normal diplayed page...
End If
End Sub

Marc

Nov 21 '05 #5
Actually, this looks more like what I want to do...we want the
redirect/transfer to be transparent to the user. So, in that case we would
not want the URL to display the page that it was being redirected to. That
makes perfect sense - thanks SO much! I really appreciate your help, and
since I've read both of your return posts, thanks for the code to keep my
pages from displaying too! Have a very Merry Christmas - Cheers :-)

Coleen
"Marc Cramer" <cr*******@comcast.net> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello...

Not a dumb question at all.

quoted from msdn help
"You may want to redirect users from one Web Forms page to another
page. You might do this to display a page that is matched to the user's
browser capabilities or is written in the language that the user
speaks.

There are two ways to redirect pages:

Using a server-side method. In this scenario, the server simply
transfers the context to another page. The advantage is that you can
share page context information between pages. The disadvantage is that
the user's browser does not know about the transfer, so the browser's
history is not updated. If the user refreshes the page, unexpected
results can occur.

Using the browser. In this scenario, you send a command to the user's
browser that causes the browser to fetch a different page. The
advantage is that the browser's history is updated. The disadvantage is
that this scenario performs an extra round trip, which can affect
performance."
From my experience using Server.Transfer you can pass the form

submission from page to page but the URL displayed in the browser is
not changed to reflect the page they were transferred to, while with
Response.Redirect you have to handle the form submission on each page
or it is lost, but the URL is updated to reflect where they are...

Just a reminder:
if using cookies the values to be stored are not set on the client
until the page has been sent...
so could run into problems if transfer, set value, transfer and try to
read value prior to page postback
This happens because the client cookie hasn't been updated yet since
the page hasn't gone to the client and updated the cookie

I suggest trying the Server.Transfer() to go page to page but on the
page that is immediately prior to your final page do a
Response.Redirect so that the URL matches and if they press back in the
browser they will be taken to the original starting page.
Make sense?

Marc

Nov 21 '05 #6
Glad to help.
Have a Merry Christmas also.

Marc

Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g.,...
5
by: PaulThomas | last post by:
Working with XP-Pro and VS.Net I have set my Start Page to "Home.aspx" but the application always starts the "Login" page - - - How can I change the start page to the Home.aspx??? On the login...
3
by: Pooja Renukdas | last post by:
Hello, I have this web site where only two pages have to be secure pages and I need to call them using https, but since I have my development server and my production web server, I dont want to...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
13
by: Stephen Kay | last post by:
Is there a way to redirect every single page on an existing web site through a php function? In other words, say I have a whole functional HTML web site, never written to use any php. Now I...
6
by: Joseph Geretz | last post by:
I have the following class which I am serializing and passing back and forth between my Web Service application and the client. public class Token : SoapHeader { public string SID; public...
1
by: assgar | last post by:
Hi I was using a schroll bar to display multiple rows of dynamically created from database records. The scrolling was not displaying the data properly so I have decided to use pagination. The...
2
by: =?ISO-8859-1?Q?Fran=E7ois_de_Dardel?= | last post by:
I am not sure if this is the proper forum, but I always found very helpful information here and I would like to have the advice of experts. Just before new year (end Dec 2006), my internet...
3
by: =?Utf-8?B?UGF0UA==?= | last post by:
We have a site that gets many requests for nonexistent pages, files and folders. We want those requests redirected to the index page. However, for static files (i.e. images and some other...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.