Response vs Server ???

Discussion in 'ASP .Net' started by =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=, Sep 29, 2005.

  1. Dear all,

    I have a problem to identify when I need to use
    Response.Redirect("mypage.aspx") or Server.Transfert("myPage.aspx") ?

    Does any one have any tips for remembering ?

    regards
    thanks
    serge
    =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=, Sep 29, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=

    Brock Allen Guest

    Server.Transfer switches to the other page mid-request from the client's
    perspective. Since it's all server side, the client has no idea the server's
    done this. The URL in the browser will be the first page.

    Response.Redirect sends back a 302 (IIRC) and a location for the new page
    to request. So the browser makes a second request into the server for the
    other page. The URL in the browser will be that of the second page since
    the browser had to make the second request.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen

    > Dear all,
    >
    > I have a problem to identify when I need to use
    > Response.Redirect("mypage.aspx") or Server.Transfert("myPage.aspx") ?
    >
    > Does any one have any tips for remembering ?
    >
    > regards
    > thanks
    > serge
    Brock Allen, Sep 29, 2005
    #2
    1. Advertising

  3. Thanks brok for your answer, but I forgot to tell you that I am beginer in
    asp and I did not catch what you are saying, do you have a simple way ?

    When I should use one compare to the other?

    I am just learning ASP and try to understand clearly each things in order t
    prepare my exams. And as long as one thing in not clear in my mind I am not
    able to go further.

    Thanks if you cold clarify your answer for a beginner

    regards
    serge

    "Brock Allen" wrote:

    > Server.Transfer switches to the other page mid-request from the client's
    > perspective. Since it's all server side, the client has no idea the server's
    > done this. The URL in the browser will be the first page.
    >
    > Response.Redirect sends back a 302 (IIRC) and a location for the new page
    > to request. So the browser makes a second request into the server for the
    > other page. The URL in the browser will be that of the second page since
    > the browser had to make the second request.
    >
    > -Brock
    > DevelopMentor
    > http://staff.develop.com/ballen
    >
    > > Dear all,
    > >
    > > I have a problem to identify when I need to use
    > > Response.Redirect("mypage.aspx") or Server.Transfert("myPage.aspx") ?
    > >
    > > Does any one have any tips for remembering ?
    > >
    > > regards
    > > thanks
    > > serge

    >
    >
    >
    =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=, Sep 29, 2005
    #3
  4. =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=

    Brock Allen Guest

    In that case, I'd suggest using Response.Redirect -- I use that much more
    than I use Server.Transfer. In essence it's simply saying that your page
    has decided that the user should go somewhere else (to a different page).

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen

    > Thanks brok for your answer, but I forgot to tell you that I am
    > beginer in asp and I did not catch what you are saying, do you have a
    > simple way ?
    >
    > When I should use one compare to the other?
    >
    > I am just learning ASP and try to understand clearly each things in
    > order t prepare my exams. And as long as one thing in not clear in my
    > mind I am not able to go further.
    >
    > Thanks if you cold clarify your answer for a beginner
    >
    > regards
    > serge
    > "Brock Allen" wrote:
    >
    >> Server.Transfer switches to the other page mid-request from the
    >> client's perspective. Since it's all server side, the client has no
    >> idea the server's done this. The URL in the browser will be the first
    >> page.
    >>
    >> Response.Redirect sends back a 302 (IIRC) and a location for the new
    >> page to request. So the browser makes a second request into the
    >> server for the other page. The URL in the browser will be that of the
    >> second page since the browser had to make the second request.
    >>
    >> -Brock
    >> DevelopMentor
    >> http://staff.develop.com/ballen
    >>> Dear all,
    >>>
    >>> I have a problem to identify when I need to use
    >>> Response.Redirect("mypage.aspx") or Server.Transfert("myPage.aspx")
    >>> ?
    >>> Does any one have any tips for remembering ?
    >>>
    >>> regards
    >>> thanks
    >>> serge
    Brock Allen, Sep 29, 2005
    #4
    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. Charles A. Lackman
    Replies:
    2
    Views:
    8,002
    Charles A. Lackman
    Jan 11, 2006
  2. Matthew Wieder

    Response.Write and Response.Redirect

    Matthew Wieder, Jul 17, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    694
    Kevin Spencer
    Jul 17, 2003
  3. Promenade

    Response.Expires and Response.Cache

    Promenade, Dec 5, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    30,749
    Promenade
    Dec 5, 2003
  4. Sehboo
    Replies:
    3
    Views:
    8,800
    Sehboo
    Dec 10, 2003
  5. Calvin Lai
    Replies:
    6
    Views:
    20,851
    Joerg Jooss
    Dec 31, 2003
Loading...

Share This Page