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.redire ct 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 1 988
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****@blueyon der.co.uk> wrote in message
news:OT******** *****@tk2msftng p13.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.redire ct 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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 to the Item page "ViewItem.aspx" with
a simple :
Server.Transfer("ViewItem.aspx");
I'd like to pass another HTTP parameter so that in the...
|
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 execute the database.transfer method
of the SQLDMO.
Can anyone tell a good solution to this problem??
try
{
|
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 foo.aspx server.transfer()ed to
http://www.domain.com/somefolder/bar.aspx I need '/somefolder/bar.aspx'.
Thanks in advance.
|
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 falls into
an infinite loop and later a StackOverflow Exception. I need to do this and
not a Response.Redirect or a transfer with the bool in...
|
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
PictureGallery.aspx?id=30 to display gallery 30. In this way I have a
database driven picture gallery. To improve indexing, I put code in
Global.asax to...
| |
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 to get it to work in Visual Basic. I
tried coding it once myself from scratch and then modified a class that I
found on a newsgroup (referenced...
|
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 methods.
Anyway, if what I want to do is send a command to change the file
permission settings of a file (or files), I assume I would use...
|
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
frmAdmin.aspx
so in the onClick event I have the following code
Server.Transfer("frmAdmin.aspx", true)
|
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 button (regardless of type: button, linkButton, imageButton)
3- (first) async call works fine
4 - click again to make second async call and somehow...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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...
| |
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. ...
|
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...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
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...
|
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...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |