Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Why does Transfer hide the target page's address?

Reply
Thread Tools

Why does Transfer hide the target page's address?

 
 
dee
Guest
Posts: n/a
 
      09-08-2005
Hi,
I'm curious why MS decided to have Transfer hide the target page's url
invisible?
Any guesses ?
Thanks.
Dee.


 
Reply With Quote
 
 
 
 
Peter Rilling
Guest
Posts: n/a
 
      09-08-2005
Microsoft did not decide anything, it is just the behavior of the server.

On a Redirect, a command is sent back to the browser and it is the
responsibility of the browser to redirect to the location. On a Transfer,
no server-browser interaction happens. The server just simply executes
different code, but the browser has no way of knowing that because it never
receives any signal from the server. The browser does not care what code
executes on the server as long as it receives some HTML.

This is one reason that I will not use Transfer (although it has its
purpose, but not very often).

"dee" <> wrote in message
news:...
> Hi,
> I'm curious why MS decided to have Transfer hide the target page's url
> invisible?
> Any guesses ?
> Thanks.
> Dee.
>



 
Reply With Quote
 
 
 
 
Marina
Guest
Posts: n/a
 
      09-08-2005
Because in this case the browser doesn't get notified that a redirect
occurred. It thinks it received the page originally requested.
If you want the new page's URL to show up, use Response.Redirect. This
informs the browser of the redirect.

"dee" <> wrote in message
news:...
> Hi,
> I'm curious why MS decided to have Transfer hide the target page's url
> invisible?
> Any guesses ?
> Thanks.
> Dee.
>



 
Reply With Quote
 
dee
Guest
Posts: n/a
 
      09-08-2005
Thanks Marina,
Does redirect involve one extra trip to the server?

"Marina" <> wrote in message
news:...
> Because in this case the browser doesn't get notified that a redirect
> occurred. It thinks it received the page originally requested.
> If you want the new page's URL to show up, use Response.Redirect. This
> informs the browser of the redirect.
>
> "dee" <> wrote in message
> news:...
>> Hi,
>> I'm curious why MS decided to have Transfer hide the target page's url
>> invisible?
>> Any guesses ?
>> Thanks.
>> Dee.
>>

>
>



 
Reply With Quote
 
dee
Guest
Posts: n/a
 
      09-08-2005
Thanks Peter,
What would be the advantage of using Transfer?

"Peter Rilling" <> wrote in message
news:...
> Microsoft did not decide anything, it is just the behavior of the server.
>
> On a Redirect, a command is sent back to the browser and it is the
> responsibility of the browser to redirect to the location. On a Transfer,
> no server-browser interaction happens. The server just simply executes
> different code, but the browser has no way of knowing that because it
> never receives any signal from the server. The browser does not care what
> code executes on the server as long as it receives some HTML.
>
> This is one reason that I will not use Transfer (although it has its
> purpose, but not very often).
>
> "dee" <> wrote in message
> news:...
>> Hi,
>> I'm curious why MS decided to have Transfer hide the target page's url
>> invisible?
>> Any guesses ?
>> Thanks.
>> Dee.
>>

>
>



 
Reply With Quote
 
KMA
Guest
Posts: n/a
 
      09-08-2005

Precisely because it hides the URL. Imagine you have dynamically created
pages. The URLs don't represent actual pages on your server. You intercept
the request for a non-existant URL and return your dynamically created page.
The browser still shows the expected URL, and not the URL of the page that
actually did the work.

eg User clicks on link
http://www.myshop.com/household/elec...tmaster5000.as
px

which doesn't exists. Your code looks in the database for the product
details and sends back html. Users' browser still shows the fake URL.

Another reasonto use transfer is to reduce round trips.



"dee" <> wrote in message
news:...
> Thanks Peter,
> What would be the advantage of using Transfer?
>
> "Peter Rilling" <> wrote in message
> news:...
> > Microsoft did not decide anything, it is just the behavior of the

server.
> >
> > On a Redirect, a command is sent back to the browser and it is the
> > responsibility of the browser to redirect to the location. On a

Transfer,
> > no server-browser interaction happens. The server just simply executes
> > different code, but the browser has no way of knowing that because it
> > never receives any signal from the server. The browser does not care

what
> > code executes on the server as long as it receives some HTML.
> >
> > This is one reason that I will not use Transfer (although it has its
> > purpose, but not very often).
> >
> > "dee" <> wrote in message
> > news:...
> >> Hi,
> >> I'm curious why MS decided to have Transfer hide the target page's url
> >> invisible?
> >> Any guesses ?
> >> Thanks.
> >> Dee.
> >>

> >
> >

>
>



 
Reply With Quote
 
dee
Guest
Posts: n/a
 
      09-08-2005
Thanks KMA
If user clicks on non-existing page url doesnt he get a 404 error?

"KMA" <> wrote in message news:dfpqi2$dpj$...
>
> Precisely because it hides the URL. Imagine you have dynamically created
> pages. The URLs don't represent actual pages on your server. You intercept
> the request for a non-existant URL and return your dynamically created
> page.
> The browser still shows the expected URL, and not the URL of the page that
> actually did the work.
>
> eg User clicks on link
> http://www.myshop.com/household/elec...tmaster5000.as
> px
>
> which doesn't exists. Your code looks in the database for the product
> details and sends back html. Users' browser still shows the fake URL.
>
> Another reasonto use transfer is to reduce round trips.
>
>
>
> "dee" <> wrote in message
> news:...
>> Thanks Peter,
>> What would be the advantage of using Transfer?
>>
>> "Peter Rilling" <> wrote in message
>> news:...
>> > Microsoft did not decide anything, it is just the behavior of the

> server.
>> >
>> > On a Redirect, a command is sent back to the browser and it is the
>> > responsibility of the browser to redirect to the location. On a

> Transfer,
>> > no server-browser interaction happens. The server just simply executes
>> > different code, but the browser has no way of knowing that because it
>> > never receives any signal from the server. The browser does not care

> what
>> > code executes on the server as long as it receives some HTML.
>> >
>> > This is one reason that I will not use Transfer (although it has its
>> > purpose, but not very often).
>> >
>> > "dee" <> wrote in message
>> > news:...
>> >> Hi,
>> >> I'm curious why MS decided to have Transfer hide the target page's url
>> >> invisible?
>> >> Any guesses ?
>> >> Thanks.
>> >> Dee.
>> >>
>> >
>> >

>>
>>

>
>



 
Reply With Quote
 
Mythran
Guest
Posts: n/a
 
      09-08-2005

"dee" <> wrote in message
news:...
> Hi,
> I'm curious why MS decided to have Transfer hide the target page's url
> invisible?
> Any guesses ?
> Thanks.
> Dee.
>


It executes another files code.


Server.Transfer requires no extra round-trip.
Response.Redirect does.

You use, as an example, Server.Transfer to transfer to another page when an
exception occurs so you can show a proper exception. If you use
Server.Transfer, you can use Server.GetLastError() to get the exception that
was thrown. If you use Server.Redirect, you cannot. That is one useful
reason why you would use Server.Transfer

HTH,
Mythran

 
Reply With Quote
 
Jeremy Ames
Guest
Posts: n/a
 
      09-08-2005
Technically, the page KMA listed does exist. It is just a "worker" page that
does nothing but processing, and it sends you to the correct page once
processing is complete. That is generally what you would use a transfer for.

"dee" <> wrote in message
news:%...
> Thanks KMA
> If user clicks on non-existing page url doesnt he get a 404 error?
>
> "KMA" <> wrote in message
> news:dfpqi2$dpj$...
>>
>> Precisely because it hides the URL. Imagine you have dynamically created
>> pages. The URLs don't represent actual pages on your server. You
>> intercept
>> the request for a non-existant URL and return your dynamically created
>> page.
>> The browser still shows the expected URL, and not the URL of the page
>> that
>> actually did the work.
>>
>> eg User clicks on link
>> http://www.myshop.com/household/elec...tmaster5000.as
>> px
>>
>> which doesn't exists. Your code looks in the database for the product
>> details and sends back html. Users' browser still shows the fake URL.
>>
>> Another reasonto use transfer is to reduce round trips.
>>
>>
>>
>> "dee" <> wrote in message
>> news:...
>>> Thanks Peter,
>>> What would be the advantage of using Transfer?
>>>
>>> "Peter Rilling" <> wrote in message
>>> news:...
>>> > Microsoft did not decide anything, it is just the behavior of the

>> server.
>>> >
>>> > On a Redirect, a command is sent back to the browser and it is the
>>> > responsibility of the browser to redirect to the location. On a

>> Transfer,
>>> > no server-browser interaction happens. The server just simply
>>> > executes
>>> > different code, but the browser has no way of knowing that because it
>>> > never receives any signal from the server. The browser does not care

>> what
>>> > code executes on the server as long as it receives some HTML.
>>> >
>>> > This is one reason that I will not use Transfer (although it has its
>>> > purpose, but not very often).
>>> >
>>> > "dee" <> wrote in message
>>> > news:...
>>> >> Hi,
>>> >> I'm curious why MS decided to have Transfer hide the target page's
>>> >> url
>>> >> invisible?
>>> >> Any guesses ?
>>> >> Thanks.
>>> >> Dee.
>>> >>
>>> >
>>> >
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Colin Peters
Guest
Posts: n/a
 
      09-08-2005
Yep. but the method I describe involves catching the 404 with a custome
error page. this custom error page looks at the requested url which is
passed as a parameter and, for example, does a db lookup on Dustmaster5000.

the nice thing is that you can tailor the url "pseudo sub directories"
as much as you want. Different languages for instance. Without actually
having to create the whole directory tree. also some search engines
attach relevance to the URL components.

I don't see how you can create a (maintainable) large website any other way.

dee wrote:
> Thanks KMA
> If user clicks on non-existing page url doesnt he get a 404 error?
>
> "KMA" <> wrote in message news:dfpqi2$dpj$...
>
>>Precisely because it hides the URL. Imagine you have dynamically created
>>pages. The URLs don't represent actual pages on your server. You intercept
>>the request for a non-existant URL and return your dynamically created
>>page.
>>The browser still shows the expected URL, and not the URL of the page that
>>actually did the work.
>>
>>eg User clicks on link
>>http://www.myshop.com/household/elec...tmaster5000.as
>>px
>>
>>which doesn't exists. Your code looks in the database for the product
>>details and sends back html. Users' browser still shows the fake URL.
>>
>>Another reasonto use transfer is to reduce round trips.
>>
>>
>>
>>"dee" <> wrote in message
>>news:...
>>
>>>Thanks Peter,
>>>What would be the advantage of using Transfer?
>>>
>>>"Peter Rilling" <> wrote in message
>>>news:...
>>>
>>>>Microsoft did not decide anything, it is just the behavior of the

>>
>>server.
>>
>>>>On a Redirect, a command is sent back to the browser and it is the
>>>>responsibility of the browser to redirect to the location. On a

>>
>>Transfer,
>>
>>>>no server-browser interaction happens. The server just simply executes
>>>>different code, but the browser has no way of knowing that because it
>>>>never receives any signal from the server. The browser does not care

>>
>>what
>>
>>>>code executes on the server as long as it receives some HTML.
>>>>
>>>>This is one reason that I will not use Transfer (although it has its
>>>>purpose, but not very often).
>>>>
>>>>"dee" <> wrote in message
>>>>news:.. .
>>>>
>>>>>Hi,
>>>>>I'm curious why MS decided to have Transfer hide the target page's url
>>>>>invisible?
>>>>>Any guesses ?
>>>>>Thanks.
>>>>>Dee.
>>>>>
>>>>
>>>>
>>>

>>

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in setting Target Node and Target Tree Property mohit ASP .Net 0 01-23-2008 05:41 AM
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
Detect Target of Server.Transfer? poi ASP .Net 1 11-12-2003 05:19 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57