What is the difference?

Discussion in 'ASP .Net' started by odwrotnie, Aug 1, 2006.

  1. odwrotnie

    odwrotnie Guest

    Hi,

    what is the difference between
    Response.Redirect("Stop.aspx");
    and
    Server.Transfer("Stop.aspx");
    ?

    --
    Best regards,
    Odwrotnie.
    odwrotnie, Aug 1, 2006
    #1
    1. Advertising

  2. odwrotnie

    Mark Rae Guest

    "odwrotnie" <> wrote in message
    news:eek:p.tdlqebmvdvqlmf@odwrotnie...

    > what is the difference between
    > Response.Redirect("Stop.aspx");
    > and
    > Server.Transfer("Stop.aspx");


    1) Launch your Internet browser (IE, FireFox, Netscape, Opera etc)

    2) Navigate to http://www.google.com

    3) Enter the text below in the box:

    "Response.Redirect" "Server.Transfer" difference

    4) Hit the button
    Mark Rae, Aug 1, 2006
    #2
    1. Advertising

  3. Classic. :)
    --
    Co-founder, Eggheadcafe.com developer portal:
    http://www.eggheadcafe.com
    UnBlog:
    http://petesbloggerama.blogspot.com




    "Mark Rae" wrote:

    > "odwrotnie" <> wrote in message
    > news:eek:p.tdlqebmvdvqlmf@odwrotnie...
    >
    > > what is the difference between
    > > Response.Redirect("Stop.aspx");
    > > and
    > > Server.Transfer("Stop.aspx");

    >
    > 1) Launch your Internet browser (IE, FireFox, Netscape, Opera etc)
    >
    > 2) Navigate to http://www.google.com
    >
    > 3) Enter the text below in the box:
    >
    > "Response.Redirect" "Server.Transfer" difference
    >
    > 4) Hit the button
    >
    >
    >
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Aug 1, 2006
    #3
  4. :)
    Easy
    Patrick

    "Peter Bromberg [C# MVP]" <> wrote in message
    news:...
    > Classic. :)
    > --
    > Co-founder, Eggheadcafe.com developer portal:
    > http://www.eggheadcafe.com
    > UnBlog:
    > http://petesbloggerama.blogspot.com
    >
    >
    >
    >
    > "Mark Rae" wrote:
    >
    >> "odwrotnie" <> wrote in message
    >> news:eek:p.tdlqebmvdvqlmf@odwrotnie...
    >>
    >> > what is the difference between
    >> > Response.Redirect("Stop.aspx");
    >> > and
    >> > Server.Transfer("Stop.aspx");

    >>
    >> 1) Launch your Internet browser (IE, FireFox, Netscape, Opera etc)
    >>
    >> 2) Navigate to http://www.google.com
    >>
    >> 3) Enter the text below in the box:
    >>
    >> "Response.Redirect" "Server.Transfer" difference
    >>
    >> 4) Hit the button
    >>
    >>
    >>
    Patrick.O.Ige, Aug 1, 2006
    #4
  5. Response.Redirect sends to the client with a META redirect and the client
    requests the next page. Server. Transfer is solely on the server side.

    Benefit of Reponse.Redirect: User can bookmark the redirected page

    Benefit of server.Transfer: faster, as there is no trip to the client

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    *************************************************
    Think outside of the box!
    *************************************************
    "odwrotnie" <> wrote in message
    news:eek:p.tdlqebmvdvqlmf@odwrotnie...
    > Hi,
    >
    > what is the difference between
    > Response.Redirect("Stop.aspx");
    > and
    > Server.Transfer("Stop.aspx");
    > ?
    >
    > --
    > Best regards,
    > Odwrotnie.
    Cowboy \(Gregory A. Beamer\), Aug 1, 2006
    #5
  6. Proving, I guess, that asking questions in this group is stupid? Or, perhaps
    the questions you think are stupid do not deserve answering until the day
    google dies? :)

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    *************************************************
    Think outside of the box!
    *************************************************
    "Mark Rae" <> wrote in message
    news:...
    > "odwrotnie" <> wrote in message
    > news:eek:p.tdlqebmvdvqlmf@odwrotnie...
    >
    >> what is the difference between
    >> Response.Redirect("Stop.aspx");
    >> and
    >> Server.Transfer("Stop.aspx");

    >
    > 1) Launch your Internet browser (IE, FireFox, Netscape, Opera etc)
    >
    > 2) Navigate to http://www.google.com
    >
    > 3) Enter the text below in the box:
    >
    > "Response.Redirect" "Server.Transfer" difference
    >
    > 4) Hit the button
    >
    Cowboy \(Gregory A. Beamer\), Aug 1, 2006
    #6
  7. odwrotnie

    Mark Rae Guest

    "Cowboy (Gregory A. Beamer)" <> wrote in
    message news:...

    > Proving, I guess, that asking questions in this group is stupid? Or,
    > perhaps the questions you think are stupid do not deserve answering until
    > the day google dies? :)


    Nope - merely trying to encourage people not to quite so lazy...

    If the OP had done a simple Google search, they'd have had their answer
    immediately rather than having to wait nearly two hours for you to tell
    them...
    Mark Rae, Aug 1, 2006
    #7
  8. odwrotnie

    odwrotnie Guest

    On Tue, 01 Aug 2006 13:20:39 +0200, Mark Rae <>
    wrote:

    > Navigate to http://www.google.com


    I just wanted to have a discussion here!
    It is strange for me why Profile.Value can pass values only with Transfer
    :|.

    --
    Best regards,
    Odwrotnie.
    odwrotnie, Aug 1, 2006
    #8
  9. odwrotnie

    odwrotnie Guest

    On Tue, 01 Aug 2006 14:56:42 +0200, Cowboy (Gregory A. Beamer)
    <> wrote:

    > Response.Redirect sends to the client with a META redirect and the client
    > requests the next page. Server. Transfer is solely on the server side.


    So how this transfer works? Is it have something in common with AJAX? And
    why does the address stays unchanged with transfer?

    > Benefit of server.Transfer: faster, as there is no trip to the client


    If there is no trip to the client, how does it works that the page is
    displayed?

    --
    Best regards,
    Odwrotnie.
    odwrotnie, Aug 1, 2006
    #9
  10. "odwrotnie" <> wrote in message
    news:eek:p.tdlzejlzdvqlmf@odwrotnie...
    > On Tue, 01 Aug 2006 14:56:42 +0200, Cowboy (Gregory A. Beamer)
    > <> wrote:
    >
    >> Response.Redirect sends to the client with a META redirect and the client
    >> requests the next page. Server. Transfer is solely on the server side.

    >
    > So how this transfer works? Is it have something in common with AJAX? And
    > why does the address stays unchanged with transfer?
    >
    >> Benefit of server.Transfer: faster, as there is no trip to the client

    >
    > If there is no trip to the client, how does it works that the page is
    > displayed?
    >


    The asp.net model is based on the page controller pattern. ASP.Net provides
    a page controller that gets the request, finds and executes the page, and
    returns the HTML stream. Server.Transfer changes that flow.

    So instead of this:
    Controller gets request
    Controller finds requested page
    Controller loads and executes page
    Controller wraps output of page in HTTP protocol and ships it back

    You get this
    Controller gets request
    Controller finds requested page
    Controller loads and executes page
    Page tells controller to find a new page
    Controller finds transferred page
    Controller loads and executes page
    Controller wraps output of page in HTTP protocol and ships it back

    All this happens server side. The client is still waiting on their original
    request and has no idea that it has occurred. It is quite normal for there
    to be pages on the server that are ONLY accessible by server.transfer, where
    the client gets the output but never sees the URL.

    No, this has nothing to do with the Ajax model, although this mechanism can
    be used for any web interaction, including Ajax, limited only by the
    creativity of the developers and the requirements of the app.
    --
    --- Nick Malik [Microsoft]
    MCSD, CFPS, Certified Scrummaster
    http://blogs.msdn.com/nickmalik

    Disclaimer: Opinions expressed in this forum are my own, and not
    representative of my employer.
    I do not answer questions on behalf of my employer. I'm just a
    programmer helping programmers.
    --
    Nick Malik [Microsoft], Aug 1, 2006
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jakk
    Replies:
    4
    Views:
    12,025
  2. Nick Timkovich
    Replies:
    0
    Views:
    59
    Nick Timkovich
    Feb 25, 2014
  3. Skip Montanaro
    Replies:
    0
    Views:
    56
    Skip Montanaro
    Feb 25, 2014
  4. Peter Otten
    Replies:
    1
    Views:
    59
    Mark Lawrence
    Feb 25, 2014
  5. Peter Otten
    Replies:
    0
    Views:
    54
    Peter Otten
    Feb 25, 2014
Loading...

Share This Page