Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Server.Transfer: the URL issue


Message #1 by "Dipak Jha" <dipak.jha@p...> on Thu, 20 Mar 2003 19:20:40 +0530
Hi,

To save round trips to the server, I'm using Server.Transfer in my code
instead of Response.Redirect.
While this seems to be faster, the URL shown in the browser does not get
updated.
Is there a way to update the URL while still using Server.Transfer?

Regards,

Dipak Jha

Message #2 by "Mike Amundsen" <mike@a...> on Thu, 20 Mar 2003 16:19:23 -0500
Nope - that's why it's faster.

Redirect works like this:
- Browser asks for page1
- page1 has "redirect to page2" on it
- a message is sent to the browser that says: "hey, ask me for page2 now"
- browser asks for page2

that is why you see the page2 URL in the browser window.

Transfer works like this:
- browser asks for page1
- page1 has "redirect to page2" on it
- the *server* moves on to page2

so the browser doesn't know that it is now seeing content from page2.

BTW - this really breaks bookmarking pages<g>

MCA

> -----Original Message-----
> From: Dipak Jha [mailto:dipak.jha@p...]
> Sent: Thursday, March 20, 2003 8:51 AM
> To: ASP.NET
> Subject: [aspx] Server.Transfer: the URL issue
> 
> Hi,
> 
> To save round trips to the server, I'm using Server.Transfer in my code
> instead of Response.Redirect.
> While this seems to be faster, the URL shown in the browser does not get
> updated.
> Is there a way to update the URL while still using Server.Transfer?
> 
> Regards,
> 
> Dipak Jha
> 
> 

Message #3 by "Silas Wild" <SILAS@d...> on Thu, 20 Mar 2003 13:20:33 -0800
So are you suggesting use redirect unless you have some serious speed
problems with it?

>>> mike@a... 03/20/03 01:19PM >>>
Nope - that's why it's faster.

Redirect works like this:
- Browser asks for page1
- page1 has "redirect to page2" on it
- a message is sent to the browser that says: "hey, ask me for page2
now"
- browser asks for page2

that is why you see the page2 URL in the browser window.

Transfer works like this:
- browser asks for page1
- page1 has "redirect to page2" on it
- the *server* moves on to page2

so the browser doesn't know that it is now seeing content from page2.

BTW - this really breaks bookmarking pages<g>

MCA

> -----Original Message-----
> From: Dipak Jha [mailto:dipak.jha@p...]
> Sent: Thursday, March 20, 2003 8:51 AM
> To: ASP.NET
> Subject: [aspx] Server.Transfer: the URL issue
> 
> Hi,
> 
> To save round trips to the server, I'm using Server.Transfer in my
code
> instead of Response.Redirect.
> While this seems to be faster, the URL shown in the browser does not
get
> updated.
> Is there a way to update the URL while still using Server.Transfer?
> 
> Regards,
> 
> Dipak Jha
> 
> 



Message #4 by "Mike Amundsen" <mike@a...> on Thu, 20 Mar 2003 16:38:38 -0500
Yep. In fact, I rarely use Server.Transfer for the following reasons:

- users will not be able to bookmark pages in many cases
- some secured browsers will actually post an alert box telling the user
that they are about to be sent to a page that the user did not request.
- debugging these things can get really tricky

hope this helps.

MCA

> -----Original Message-----
> From: Silas Wild [mailto:SILAS@d...]
> Sent: Thursday, March 20, 2003 4:21 PM
> To: ASP.NET
> Subject: [aspx] RE: Server.Transfer: the URL issue
> 
> So are you suggesting use redirect unless you have some serious speed
> problems with it?
> 
> >>> mike@a... 03/20/03 01:19PM >>>
> Nope - that's why it's faster.
> 
> Redirect works like this:
> - Browser asks for page1
> - page1 has "redirect to page2" on it
> - a message is sent to the browser that says: "hey, ask me for page2
> now"
> - browser asks for page2
> 
> that is why you see the page2 URL in the browser window.
> 
> Transfer works like this:
> - browser asks for page1
> - page1 has "redirect to page2" on it
> - the *server* moves on to page2
> 
> so the browser doesn't know that it is now seeing content from page2.
> 
> BTW - this really breaks bookmarking pages<g>
> 
> MCA
> 
> > -----Original Message-----
> > From: Dipak Jha [mailto:dipak.jha@p...]
> > Sent: Thursday, March 20, 2003 8:51 AM
> > To: ASP.NET
> > Subject: [aspx] Server.Transfer: the URL issue
> >
> > Hi,
> >
> > To save round trips to the server, I'm using Server.Transfer in my
> code
> > instead of Response.Redirect.
> > While this seems to be faster, the URL shown in the browser does not
> get
> > updated.
> > Is there a way to update the URL while still using Server.Transfer?
> >
> > Regards,
> >
> > Dipak Jha
> >
> >
> 
> 
> 
> 

Message #5 by "Peter Lanoie" <planoie@n...> on Thu, 20 Mar 2003 18:00:31 -0500
Mike,

You replied earlier about how server.transfer works.  I have used it and
never seen any kind of alert regarding going to a different page.  This
makes complete sense based on what you said about how it works.

If the server takes a request from the browser for page "A", then decides to
pass execution on to page "B", how does the browser ever know this?  As far
as the browser is concerned, it is not going to a different page, it's just
seeing page "A"'s request as page "B"'s content.  Is something else
happening here that I'm unaware of?  Is there something in the HTTP response
headers that specifies the requested URL?  Understandably, if this is the
case, then the browser may be able to see the discrepancy.

Peter

-----Original Message-----
From: Mike Amundsen [mailto:mike@a...]
Sent: Thursday, March 20, 2003 16:39
To: ASP.NET
Subject: [aspx] RE: Server.Transfer: the URL issue


Yep. In fact, I rarely use Server.Transfer for the following reasons:

- users will not be able to bookmark pages in many cases
- some secured browsers will actually post an alert box telling the user
that they are about to be sent to a page that the user did not request.
- debugging these things can get really tricky

hope this helps.

MCA

> -----Original Message-----
> From: Silas Wild [mailto:SILAS@d...]
> Sent: Thursday, March 20, 2003 4:21 PM
> To: ASP.NET
> Subject: [aspx] RE: Server.Transfer: the URL issue
>
> So are you suggesting use redirect unless you have some serious speed
> problems with it?
>
> >>> mike@a... 03/20/03 01:19PM >>>
> Nope - that's why it's faster.
>
> Redirect works like this:
> - Browser asks for page1
> - page1 has "redirect to page2" on it
> - a message is sent to the browser that says: "hey, ask me for page2
> now"
> - browser asks for page2
>
> that is why you see the page2 URL in the browser window.
>
> Transfer works like this:
> - browser asks for page1
> - page1 has "redirect to page2" on it
> - the *server* moves on to page2
>
> so the browser doesn't know that it is now seeing content from page2.
>
> BTW - this really breaks bookmarking pages<g>
>
> MCA
>
> > -----Original Message-----
> > From: Dipak Jha [mailto:dipak.jha@p...]
> > Sent: Thursday, March 20, 2003 8:51 AM
> > To: ASP.NET
> > Subject: [aspx] Server.Transfer: the URL issue
> >
> > Hi,
> >
> > To save round trips to the server, I'm using Server.Transfer in my
> code
> > instead of Response.Redirect.
> > While this seems to be faster, the URL shown in the browser does not
> get
> > updated.
> > Is there a way to update the URL while still using Server.Transfer?
> >
> > Regards,
> >
> > Dipak Jha
> >
> >
>
>
>
>



Message #6 by "Mike Amundsen" <mike@a...> on Thu, 20 Mar 2003 20:13:36 -0500
Peter:

Hi, well - I was *totally* wrong on that point, sorry.
browsers might pop alerts when you use a redirect, not a transfer.  I 
was in
a hurry and put it in the wrong list. 

Thanks for keeping me honest.

MCA

> -----Original Message-----
> From: Peter Lanoie [mailto:planoie@n...]
> Sent: Thursday, March 20, 2003 6:01 PM
> To: ASP.NET
> Subject: [aspx] RE: Server.Transfer: the URL issue
>
> Mike,
>
> You replied earlier about how server.transfer works.  I have used it 
and
> never seen any kind of alert regarding going to a different page.  
This
> makes complete sense based on what you said about how it works.
>
> If the server takes a request from the browser for page "A", then 
decides
> to
> pass execution on to page "B", how does the browser ever know this?  
As
> far
> as the browser is concerned, it is not going to a different page, it's
> just
> seeing page "A"'s request as page "B"'s content.  Is something else
> happening here that I'm unaware of?  Is there something in the HTTP
> response
> headers that specifies the requested URL?  Understandably, if this is 
the
> case, then the browser may be able to see the discrepancy.
>
> Peter
>
> -----Original Message-----
> From: Mike Amundsen [mailto:mike@a...]
> Sent: Thursday, March 20, 2003 16:39
> To: ASP.NET
> Subject: [aspx] RE: Server.Transfer: the URL issue
>
>
> Yep. In fact, I rarely use Server.Transfer for the following reasons:
>
> - users will not be able to bookmark pages in many cases
> - some secured browsers will actually post an alert box telling the 
user
> that they are about to be sent to a page that the user did not 
request.
> - debugging these things can get really tricky
>
> hope this helps.
>
> MCA
>
> > -----Original Message-----
> > From: Silas Wild [mailto:SILAS@d...]
> > Sent: Thursday, March 20, 2003 4:21 PM
> > To: ASP.NET
> > Subject: [aspx] RE: Server.Transfer: the URL issue
> >
> > So are you suggesting use redirect unless you have some serious 
speed
> > problems with it?
> >
> > >>> mike@a... 03/20/03 01:19PM >>>
> > Nope - that's why it's faster.
> >
> > Redirect works like this:
> > - Browser asks for page1
> > - page1 has "redirect to page2" on it
> > - a message is sent to the browser that says: "hey, ask me for page2
> > now"
> > - browser asks for page2
> >
> > that is why you see the page2 URL in the browser window.
> >
> > Transfer works like this:
> > - browser asks for page1
> > - page1 has "redirect to page2" on it
> > - the *server* moves on to page2
> >
> > so the browser doesn't know that it is now seeing content from 
page2.
> >
> > BTW - this really breaks bookmarking pages<g>
> >
> > MCA
> >
> > > -----Original Message-----
> > > From: Dipak Jha [mailto:dipak.jha@p...]
> > > Sent: Thursday, March 20, 2003 8:51 AM
> > > To: ASP.NET
> > > Subject: [aspx] Server.Transfer: the URL issue
> > >
> > > Hi,
> > >
> > > To save round trips to the server, I'm using Server.Transfer in my
> > code
> > > instead of Response.Redirect.
> > > While this seems to be faster, the URL shown in the browser does 
not
> > get
> > > updated.
> > > Is there a way to update the URL while still using 
Server.Transfer?
> > >
> > > Regards,
> > >
> > > Dipak Jha
> > >
> > >
> >
> >
> >
> >
>
>
>
>


  Return to Index