473,769 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
+ 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 5804
Hello...

I would probably try Server.Transfer or Response.Redire ct 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.redire ct, 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*******@comc ast.net> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
Hello...

I would probably try Server.Transfer or Response.Redire ct 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.Redire ct 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.Redire ct 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(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
if(Page.IsPostB ack==false)
{
// check to see if we have our flag to indicate auto redirect...
if(Request.Quer yString["Flag"]!=null)
{
// call the processing methods here...
DoStuff();
// go to next page...
Response.Redire ct("NextPage.as px", 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.EventArg s) 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.QuerySt ring("Flag") Is Nothing Then
' call the processing methods here...
DoStuff()
' go to next page...
Response.Redire ct("NextPage.as px", 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*******@comc ast.net> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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.Redire ct 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.Redire ct 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
4971
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., http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=Tidy7IDbDHA.2108%40cpmsftngxa06.phx.gbl) that indicate that ASP will queue up requests when they come in with the same "session".
5
2071
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 page that displays I have private void LinkButton1_Click(object sender, System.EventArgs e) { bool MyVar = true; Msg.Text = "ReDirecting to Home.aspx"; Response.Redirect("Home.aspx",MyVar); }
3
14047
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 enter the absolute url like response.redirect("https://myProductionServer.com/SecurePage.aspx"), because when Im working in the development server I would have to change it back and forth everytime. Is there an easy way to do this without having...
2
4356
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 displaying the contents of the data source, whilst another control updates the datasource via a command buttons implementation of 'Click', an event raised in the 'Handle Postback Events' stage of the control execution life cycle (via the...
13
2109
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 would like to have a php function handle displaying every page, for example, instead of: http://www.mysite.com/mypage.html you would call:
6
3990
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 string UID; public string PWD; }
1
3382
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 problem I am having is, if I select one item on page #1 and another on page #5 only the last item selected on page #5 is stored in the array. How can I store selections from multiple pages into one array?
2
3655
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 provided (noos.fr) had trouble with ftp, so that access to my web pages became very problematic, mostly impossible. After 2 months and many unanswered complaints, I decided to buy my own domain, subscribe with a different host and transfer all my files...
3
2734
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 extensions) we do not want to redirect and in that case want to return nothing. We had been using the 404 error page to redirect but need to discriminate the type of file being requested so that we do not return a page when an image is required. We'd...
0
9415
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10198
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10032
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9848
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8860
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6661
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5432
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3947
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 we have to send another system
2
3551
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.