locked
server.transfer instead of Response.Redirect RRS feed

  • Question

  • User2102072086 posted

    hi,

            what I have seen is when we make web app in asp.net forms, all the pages reside in one project and they are hosted on one web server having iis.

    so I decided to use server. transfer throughout and remove all response.redirect.

    s1) is it going to have any other drawbacks, except it does not go back and shows the previous page in URL.

    Friday, May 1, 2020 6:02 AM

All replies

  • User288213138 posted

    Hi rajemessage,

    s1) is it going to have any other drawbacks, except it does not go back and shows the previous page in URL.

    Server.transfer can only run between the same site on the same server, so you cannot use Server.Transfer to redirect users to a site on another server. To redirect to a site other than the server, only Response.Redirect can do it.

    And Server.Transfer maintains the original URL in the browser, it may make for confusion when debugging.

    More information about the difference between Response.Redirect and server.transfer you can refer to this link:

    https://stackoverflow.com/questions/224569/server-transfer-vs-response-redirect

    Best regards,

    Sam

    Friday, May 1, 2020 7:50 AM
  • User2102072086 posted

    if u read my post, it is written that generally, we keep everything in our asp.net webform project and host in one IIS server, so the question was asked in this context,

    I do not think in the above case there is any other server is included.

    Friday, May 1, 2020 10:01 AM
  • User475983607 posted

    You are the only one that can answer this question since you have all the source code.

    I can only tell you that changing all redirects to transfers will not work in any of the Web Forms application that I support.  

    Friday, May 1, 2020 1:41 PM