473,399 Members | 3,832 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,399 software developers and data experts.

server.transfer and URL address - confused

Hi,

I'm aware of the different ways to pass variables between ASP.Net pages. For
pages that need to pass a variable, we're using the server.transfer method.
For others, we're using repsonse.redirect. My understanding was that the
server.transfer method doesn't update the URL address bar. However, I've a
situation that I'm a bit confused about and would appreciate any advice on
why the following is occuring (i.e. why I'm obviously missing something in
all this):

1) Move from Page1.aspx to Page2.aspx via a response.redirect. URL address
bar changes to Page2.aspx.
2) Move from Page2.aspx to Page3.aspx via a server.transfer. URL address bar
stays with Page2.aspx.
3) Move from Page3.aspx to Page4.aspx via a server.transfer. URL address bar
changes to Page3.aspx.

...During the move in point 3, I would have thought that the URL address bar
would stay with Page2.aspx. Is the above the correct behaviour, or is there
something amiss?

Thanks for any advice on this.

Cheers

Bob
Nov 18 '05 #1
4 4866
Hi, Bob,

Note that between step 2 and 3 there is a post to the server to Page3.aspx.
That's why you see Page3.aspx in the address bar.

Greetings
Martin
"Bob H" <bh**@le.ac.uk> wrote in message
news:c2**********@south.jnrs.ja.net...
Hi,

I'm aware of the different ways to pass variables between ASP.Net pages. For pages that need to pass a variable, we're using the server.transfer method. For others, we're using repsonse.redirect. My understanding was that the
server.transfer method doesn't update the URL address bar. However, I've a
situation that I'm a bit confused about and would appreciate any advice on
why the following is occuring (i.e. why I'm obviously missing something in
all this):

1) Move from Page1.aspx to Page2.aspx via a response.redirect. URL address
bar changes to Page2.aspx.
2) Move from Page2.aspx to Page3.aspx via a server.transfer. URL address bar stays with Page2.aspx.
3) Move from Page3.aspx to Page4.aspx via a server.transfer. URL address bar changes to Page3.aspx.

..During the move in point 3, I would have thought that the URL address bar would stay with Page2.aspx. Is the above the correct behaviour, or is there something amiss?

Thanks for any advice on this.

Cheers

Bob

Nov 18 '05 #2
Looks weird, only a new client side request for page3.aspx should be able to
change the URL. Is there any intermediate steps or it is done all in one
flow (any postback in beetween ?)

You could easily try to repro this behaviour with 3 empty pages...

As a side note, I would use Server.Transfer only for processing only pages
(ie the user shouldn't care to be on another page than the one he sees in
his address bar, other said I would not use it for navigation purpose).

Patrice

--

"Bob H" <bh**@le.ac.uk> a écrit dans le message de
news:c2**********@south.jnrs.ja.net...
Hi,

I'm aware of the different ways to pass variables between ASP.Net pages. For pages that need to pass a variable, we're using the server.transfer method. For others, we're using repsonse.redirect. My understanding was that the
server.transfer method doesn't update the URL address bar. However, I've a
situation that I'm a bit confused about and would appreciate any advice on
why the following is occuring (i.e. why I'm obviously missing something in
all this):

1) Move from Page1.aspx to Page2.aspx via a response.redirect. URL address
bar changes to Page2.aspx.
2) Move from Page2.aspx to Page3.aspx via a server.transfer. URL address bar stays with Page2.aspx.
3) Move from Page3.aspx to Page4.aspx via a server.transfer. URL address bar changes to Page3.aspx.

..During the move in point 3, I would have thought that the URL address bar would stay with Page2.aspx. Is the above the correct behaviour, or is there something amiss?

Thanks for any advice on this.

Cheers

Bob


Nov 18 '05 #3
Thanks for the replies.

I setup 4 blank pages with the same navigation:
- Page1 to Page2 with response.redirect
- Page2 to Page3 to Page4 with server.transfer

Same thing happens. I had forgot about the postback to Page3 (hence the URL
change to Page3 when navigating to Page4)...although I had thought that only
client side could update the address bar (?).

I suppose what I'm after is to be able to navigate to another page, pass the
variables (in a 'hidden' format) and have the URL bar updated (without the
issues of querystring & sessions). Is it possible to server.transfer to an
intermediate page (e.g. Page2.5), before redirecting to Page3 (with
variables and URL bar intact)??...although doesn't this just pose the same
problem of how to get variables from 2.5 to 3?

cheers

Bob
"Bob H" <bh**@le.ac.uk> a écrit dans le message de
news:c2**********@south.jnrs.ja.net...
Hi,

I'm aware of the different ways to pass variables between ASP.Net pages.

For
pages that need to pass a variable, we're using the server.transfer

method.
For others, we're using repsonse.redirect. My understanding was that the
server.transfer method doesn't update the URL address bar. However, I've a situation that I'm a bit confused about and would appreciate any advice on why the following is occuring (i.e. why I'm obviously missing something in all this):

1) Move from Page1.aspx to Page2.aspx via a response.redirect. URL address bar changes to Page2.aspx.
2) Move from Page2.aspx to Page3.aspx via a server.transfer. URL address

bar
stays with Page2.aspx.
3) Move from Page3.aspx to Page4.aspx via a server.transfer. URL address

bar
changes to Page3.aspx.

..During the move in point 3, I would have thought that the URL address

bar
would stay with Page2.aspx. Is the above the correct behaviour, or is

there
something amiss?

Thanks for any advice on this.

Cheers

Bob

Nov 18 '05 #4
The postback means the data in your form are submitted by the browser to a
page. This *is* a client side request and it updates then the URL.

If you need to let the user know he is on a new page, use Response.Redirect
(and its additional small hit)
If this is a processing only page use Server.Transfer.

Patrice
--

"Bob H" <bh**@le.ac.uk> a écrit dans le message de
news:c2**********@south.jnrs.ja.net...
Thanks for the replies.

I setup 4 blank pages with the same navigation:
- Page1 to Page2 with response.redirect
- Page2 to Page3 to Page4 with server.transfer

Same thing happens. I had forgot about the postback to Page3 (hence the URL change to Page3 when navigating to Page4)...although I had thought that only client side could update the address bar (?).

I suppose what I'm after is to be able to navigate to another page, pass the variables (in a 'hidden' format) and have the URL bar updated (without the
issues of querystring & sessions). Is it possible to server.transfer to an
intermediate page (e.g. Page2.5), before redirecting to Page3 (with
variables and URL bar intact)??...although doesn't this just pose the same
problem of how to get variables from 2.5 to 3?

cheers

Bob
"Bob H" <bh**@le.ac.uk> a écrit dans le message de
news:c2**********@south.jnrs.ja.net...
Hi,

I'm aware of the different ways to pass variables between ASP.Net pages.
For
pages that need to pass a variable, we're using the server.transfer method.
For others, we're using repsonse.redirect. My understanding was that
the server.transfer method doesn't update the URL address bar. However,
I've a situation that I'm a bit confused about and would appreciate any
advice
on why the following is occuring (i.e. why I'm obviously missing
something
in all this):

1) Move from Page1.aspx to Page2.aspx via a response.redirect. URL address bar changes to Page2.aspx.
2) Move from Page2.aspx to Page3.aspx via a server.transfer. URL

address bar
stays with Page2.aspx.
3) Move from Page3.aspx to Page4.aspx via a server.transfer. URL
address bar
changes to Page3.aspx.

..During the move in point 3, I would have thought that the URL
address bar
would stay with Page2.aspx. Is the above the correct behaviour, or is

there
something amiss?

Thanks for any advice on this.

Cheers

Bob



Nov 18 '05 #5

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

Similar topics

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...
4
by: john | last post by:
I have an app that uses Server.Transfer from page1 to page2. page2 needs to be able to read all the values from page1's form. The problem is, if the user clicks the back button on page2 after a...
2
by: Ryu | last post by:
Hi, it seems that Server.Transfer only preserve the url only for 1 hop. For example I have A.aspx, B.aspx and C.aspx. If i do a server.transfer at A.aspx to B.aspx Server.Transfer("B.aspx") the...
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...
8
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
8
by: p3t3r | last post by:
I am using .NET2 and have a number of aspx pages. On each page is a LinkButton that performs a server.transfer() to another page. If we use page names A,B,C,D,E as an example. I start on page A...
3
by: =?Utf-8?B?TWFyaw==?= | last post by:
I have an ASP.Net 1.1 site that uses Server.Transfer() heavily. Specifically, I use a page called /misc/pagenotfound.aspx to implement logic that maps URLs of the format /vdir/california to a...
5
by: JX | last post by:
Is it possible to replace the address in client browser for server.transfer with the the real location?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
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...

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.