473,396 Members | 2,011 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,396 software developers and data experts.

I've stopped using Server.Transfer

Hi,

I just thought someone reading this might be interested to know that I've
just decided to stop using server.transfer and replace it with
response.redirect instead.

The app had several places where you would click on a button, it would go
away and do something and take you to the next page. When I first started
using asp.net I was keen on server.transfer because it avoids an unnecessary
round trip to the browser. However, the downsides of this approach are:

1. URL as shown in the browser does not correspond to the page the user is
actually seeing.

2. if he refreshes the new page this has to be done by re-posting the
previous page. This may cause problems on the server if the action is not
idempotent, but at the very least will cause a warning from IE about having
to post

3. if the new page and old page are in different directories, any relative
references to external resources (e.g. <img src="../images/foo.gif">) in the
new page won't work because the URL seen by the browser is the old one

I realise that 2 and 3 are side-effects of 1. For my money, unless you want
to read the form values from the old page in the new one, you're better off
living with the extra network traffic and doing a redirect.

Andy
Nov 19 '05 #1
1 980
I agree. I have never used Server.Transfer for the vary reasons that you
specify. It is not that much work for the browser to follow a redirect
command.
"Andy Fish" <aj****@blueyonder.co.uk> wrote in message
news:OT*************@tk2msftngp13.phx.gbl...
Hi,

I just thought someone reading this might be interested to know that I've
just decided to stop using server.transfer and replace it with
response.redirect instead.

The app had several places where you would click on a button, it would go
away and do something and take you to the next page. When I first started
using asp.net I was keen on server.transfer because it avoids an unnecessary round trip to the browser. However, the downsides of this approach are:

1. URL as shown in the browser does not correspond to the page the user is
actually seeing.

2. if he refreshes the new page this has to be done by re-posting the
previous page. This may cause problems on the server if the action is not
idempotent, but at the very least will cause a warning from IE about having to post

3. if the new page and old page are in different directories, any relative
references to external resources (e.g. <img src="../images/foo.gif">) in the new page won't work because the URL seen by the browser is the old one

I realise that 2 and 3 are side-effects of 1. For my money, unless you want to read the form values from the old page in the new one, you're better off living with the extra network traffic and doing a redirect.

Andy

Nov 19 '05 #2

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

Similar topics

5
by: Julien C. | last post by:
Hi all, I have an "EditeItem.aspx" page which lets me edit properties of an "Item". In the OnClick() event of my Save button, I do save Item changes to the database and then I redirect the user...
1
by: Ganesh Ramamurthy | last post by:
I get the above message when run the dll in release mode. However, it doesnt come when compiled in the debug mode. Is the error due to some stack overflow?? I get this error when trying to...
1
by: Terry Mulvany | last post by:
Grettings, Normally I can use Request.RawUrl to get the 'current' page (amongst many other things). But in the case of using a Server.Transfer but the path from the root of the site . So if...
11
by: Alexander Bosch | last post by:
Hi, I'm having a problem similar to the one that's stated in this KB http://support.microsoft.com/default.aspx?scid=kb;en-us;839521 When I'm posting a page to itself with the bool value as true it...
2
by: David Berman | last post by:
It seems that my site is losing session information when using Server.Transfer. I have a page called PictureGallery.aspx. It takes an argument which is an index id, so it would look like...
7
by: Mark Waser | last post by:
Hi all, I'm trying to post multipart/form-data to a web page but seem to have run into a wall. I'm familiar with RFC 1867 and have done this before (with AOLServer and Tcl) but just can't seem...
5
by: John Salerno | last post by:
I'm experimenting with this now and I'm a little confused about transferring commands. This might be more of an FTP question than strictly Python, but it's still related to how to use the ftplib...
1
by: Henry | last post by:
Hello I'm using server.transfer() to navigate between pages, and I don't understand why the URL changes while navigating. My start page is default.aspx and from a button I want to navigate to...
1
by: Rachel | last post by:
We recently upgraded to ASP.NET 2 AJAX Beta 2 an since we are encountering the following problem: STEPS: 1- navigate to a page containing a UpdatePanel using SERVER.TRANSFER 2- click on a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...
0
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,...

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.