473,287 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Response.Redirect vs Server.Transfer

Hi,

I'd like to know the performance related differences between
Response.Redirect and Server.Transfer.
I'd like to redirect the user to a different page.
I can either do a Response.Redirect("URL") or a Server.Transfer("URL").
So I'd like to find out which is more efficient/better.
Can anyone please tell me or give any pointers to links on the web?

Thanks & Regards
Harsh Thakur
Nov 17 '05 #1
4 2077
From an efficiency perspective, there's no doubt that Server.Transfer is
better.
Response.Redirect requires a round trip back to the browser, while this is
unnecessary with Server.Transfer.
About the only downside to Server.Transfer is that, because all the action
stays on the server, the browser is not aware that the page has changed and
the original page's URL is still displayed in the browser. This can also
cause issues with the browser back button since the browser sees it as the
same page. If you can live with that then definitely go with
Server.Transfer.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
Developer for Hire
"Harsh Thakur" <ha****@cybage.com> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
Hi,

I'd like to know the performance related differences between
Response.Redirect and Server.Transfer.
I'd like to redirect the user to a different page.
I can either do a Response.Redirect("URL") or a Server.Transfer("URL").
So I'd like to find out which is more efficient/better.
Can anyone please tell me or give any pointers to links on the web?

Thanks & Regards
Harsh Thakur

Nov 17 '05 #2
Hi Steve,

Thanks for your response.
Now I feel much better about using Server.Transfer.

I have one more query though.
What happens to the Page object which invoked the Server.Transfer?
Lets say PageOne called Server.Transfer("PageTwo").
I know PageOne stays alive for a while longer.
When is it destroyed? Is it GC'd just like any other object?
I'd like to know this because it might mean extra memory load for the
server.

Actually, instead of using query strings, we expose a Get method on PageOne
and then call that method in the Page_Load of PageTwo.

Regards
Harsh Thakur

"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:eu**************@TK2MSFTNGP09.phx.gbl...
From an efficiency perspective, there's no doubt that Server.Transfer is
better.
Response.Redirect requires a round trip back to the browser, while this is
unnecessary with Server.Transfer.
About the only downside to Server.Transfer is that, because all the action
stays on the server, the browser is not aware that the page has changed and the original page's URL is still displayed in the browser. This can also
cause issues with the browser back button since the browser sees it as the
same page. If you can live with that then definitely go with
Server.Transfer.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
Developer for Hire
"Harsh Thakur" <ha****@cybage.com> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
Hi,

I'd like to know the performance related differences between
Response.Redirect and Server.Transfer.
I'd like to redirect the user to a different page.
I can either do a Response.Redirect("URL") or a Server.Transfer("URL").
So I'd like to find out which is more efficient/better.
Can anyone please tell me or give any pointers to links on the web?

Thanks & Regards
Harsh Thakur


Nov 17 '05 #3
The Page object is transferred also in the HttpContext. It is GC'd like any
other object. As for the memory load, I believe using Server.Transfer would
be more optimal, as it doesn't require the processing of 2 Requests.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"Harsh Thakur" <ha****@cybage.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi Steve,

Thanks for your response.
Now I feel much better about using Server.Transfer.

I have one more query though.
What happens to the Page object which invoked the Server.Transfer?
Lets say PageOne called Server.Transfer("PageTwo").
I know PageOne stays alive for a while longer.
When is it destroyed? Is it GC'd just like any other object?
I'd like to know this because it might mean extra memory load for the
server.

Actually, instead of using query strings, we expose a Get method on PageOne and then call that method in the Page_Load of PageTwo.

Regards
Harsh Thakur

"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:eu**************@TK2MSFTNGP09.phx.gbl...
From an efficiency perspective, there's no doubt that Server.Transfer is
better.
Response.Redirect requires a round trip back to the browser, while this is unnecessary with Server.Transfer.
About the only downside to Server.Transfer is that, because all the action stays on the server, the browser is not aware that the page has changed

and
the original page's URL is still displayed in the browser. This can also cause issues with the browser back button since the browser sees it as the same page. If you can live with that then definitely go with
Server.Transfer.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
Developer for Hire
"Harsh Thakur" <ha****@cybage.com> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
Hi,

I'd like to know the performance related differences between
Response.Redirect and Server.Transfer.
I'd like to redirect the user to a different page.
I can either do a Response.Redirect("URL") or a Server.Transfer("URL"). So I'd like to find out which is more efficient/better.
Can anyone please tell me or give any pointers to links on the web?

Thanks & Regards
Harsh Thakur



Nov 17 '05 #4
Hi Kevin,

Thanks for your reply.

Regards
Harsh Thakur

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:e9**************@tk2msftngp13.phx.gbl...
The Page object is transferred also in the HttpContext. It is GC'd like any other object. As for the memory load, I believe using Server.Transfer would be more optimal, as it doesn't require the processing of 2 Requests.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"Harsh Thakur" <ha****@cybage.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi Steve,

Thanks for your response.
Now I feel much better about using Server.Transfer.

I have one more query though.
What happens to the Page object which invoked the Server.Transfer?
Lets say PageOne called Server.Transfer("PageTwo").
I know PageOne stays alive for a while longer.
When is it destroyed? Is it GC'd just like any other object?
I'd like to know this because it might mean extra memory load for the
server.

Actually, instead of using query strings, we expose a Get method on PageOne
and then call that method in the Page_Load of PageTwo.

Regards
Harsh Thakur

"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:eu**************@TK2MSFTNGP09.phx.gbl...
From an efficiency perspective, there's no doubt that Server.Transfer is better.
Response.Redirect requires a round trip back to the browser, while
this is unnecessary with Server.Transfer.
About the only downside to Server.Transfer is that, because all the action stays on the server, the browser is not aware that the page has
changed
and
the original page's URL is still displayed in the browser. This can

also cause issues with the browser back button since the browser sees it as the same page. If you can live with that then definitely go with
Server.Transfer.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
Developer for Hire
"Harsh Thakur" <ha****@cybage.com> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
> Hi,
>
> I'd like to know the performance related differences between
> Response.Redirect and Server.Transfer.
> I'd like to redirect the user to a different page.
> I can either do a Response.Redirect("URL") or a Server.Transfer("URL"). > So I'd like to find out which is more efficient/better.
> Can anyone please tell me or give any pointers to links on the web?
>
> Thanks & Regards
> Harsh Thakur
>
>



Nov 17 '05 #5

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

Similar topics

11
by: Stephen | last post by:
I was wondering if someone can help me with an web application design problem. I have a aspx page which builds up an arraylist called addresses and outputs the values in the arraylist items to a...
6
by: \A_Michigan_User\ | last post by:
Ok, I give up... why do 1-4 work fine... but 5-6 give "can't find" errors? 1. Client-side VBscript code: call navigate("\\209.11.22.33\MyDir") 2. Client-side VBscript code: location.href...
3
by: Justin | last post by:
Hi, Im confused here over the usage of Response.Redirect and Server.Transfer. I used frameset for my work, what are the proper usages of the two methods that seems working similar.. The...
5
by: Paul de Goede | last post by:
I set the Response.Filter in my aspnet application but I have noticed that if you do a Server.Transfer that the filter doesn't get called. And in actual fact the response is mostly empty. It seems...
3
by: Alan Silver | last post by:
Hello, Sorry if this is a stupid question, but I can't really see much difference between these tow methods according to the scant info in the SDK. Could anyone enlighten me? TIA -- Alan...
10
by: Bill | last post by:
In file FIRST.ASP, I've got <% Response.Redirect "SECOND.ASP" %> The redirect is happening, and I'm seeing the content from SECOND.ASP in the browser, but the URL in the browser is still...
2
by: Nathan Sokalski | last post by:
The last two lines of code in the Click event of a Button Control on my page are: Me.WelcomeEmail() Response.Redirect("mainmenu.aspx") The last line of code in Me.WelcomeEmail() is:
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
3
by: jasonheath.net | last post by:
I apologize in advance for the length of this post. I wanted to get as much detail as possible in here. We have 1 web app that contains the functionality to do some single sign-on logic. The...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.