Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What is the difference between responce.redirect and server .transfer?

user-image
Question ajoutée par Rachana Koyyedi
Date de publication: 2015/06/24
Dilip Raut
par Dilip Raut , Senior software Engineer , PCS (P) Ltd.

Both responce.redirect and server.transfer methods are used to transfer a user  form one  web page to another web page. Both methods are used for same purpose but still there are some differences  as follows:

The responce.redirect method redirects a request  to new URL and specifies new URL whereas the server.transfer method request to terminate current page and start execution of new web page using the specifies new Url.

Shaikh Mohammad Asif Zafre Alam
par Shaikh Mohammad Asif Zafre Alam , software engineer , Inceptio systems DMCC

1: Response.Redirect can be used for both .aspx and HTML pages.

2: Server.Transfer can be used only for .aspx pages and is specific to ASP and ASP.NET.

muhammed shameej chelakodan
par muhammed shameej chelakodan , Senior IT Administrator , M.A Al Abdul Karim Co & Ltd

both are used for same purpose

response.redirect will show us a round trip,i.e sends an HTTP request to the browser, then the browser sends that request to the web server, then the web server delivers a response to the web browser

server.transfer sends a request directly to the web server and the web server delivers the response to the browser.

nilesh sawardekar
par nilesh sawardekar , Director , Infobytes Solutions

  • response.redirect is used the url in the address bar changes and the browser history in maintained.
  • response.redirect is used to nevigate pages/websites on the same server or on a different web server.
  • server.transfer is used to nevigate pages/websites on the same server and cannot navigate to a different web server.
  • server.transfer doesnt change the url in the address bar.
  • server.transfer is faster than response.redirect as the redirection happens on the server in one request/respnse cycle. response.redirect involves 2 requests/response cycles.
  • with server.transfter the Form Variable from the original request are preserved.

Mudassir hassan Rajpoot
par Mudassir hassan Rajpoot , I.T Manager , Boss Moulded Furniture

Response.Redirect can be used for both .aspx and HTML pages whereas Server.Transfer can be used only for .aspx pages and is specific to ASP and ASP.NET. Response.Redirect can be used to redirect a user to an external website. ... You cannot use Server.Transfer to redirect the user to a page running on a different server.

Asif Ali Khan Pathan
par Asif Ali Khan Pathan , senior software Engineer , CGI Information systems

Response.redirect works for both .Aspx and .html pages where as Server.Transfer is only specific to .Aspx pages

Response.Redirect is treated as independent request hence redirected to address(URL) present on other servers as well where as Server.Transfer is sticked to the address(URL) present on the same servers.

samir aoua
par samir aoua , Developer logiciel , ALL

Response.Redirect() will send you to a new page, update the address bar and add it to the Browser History. On your browser you can click back.

 

 Server.Transfer happens without the browser knowing anything, the browser request a page, but the server returns the content of another.

Bahadur ali Syed
par Bahadur ali Syed , Senior Software Engineer , Aljouf University

The Response.Redirect method redirects a reques the Server.Transfer method for the current request, terminates execution of the current page and starts execution of a new page using the specified URL path of the page.t to a new URL and specifies the new URL 

 

Subhasish Mukherjee
par Subhasish Mukherjee , Manager , FI-TEK PVT. LTD

Both serves the same purpose except in server.Transfer the Response Stream is not formed and the request is directly set toa new URI

Shariq Muhammad
par Shariq Muhammad , Manager , Feroze1888 Mills Limited

Response.Redirect: It sends you to another page, update address bar and creates history link. One can return to previous page by hitting browser back button.

Server.trasfer: It sends you to another page on the same server without updating address bar. One cannot retrun to previous page by hitting browser back button

Muhammad Rehan khan
par Muhammad Rehan khan , Technical Analyst , First Abu Dhabi Bank

response.redirect is happen through browser and server.tranfer happen on server to server.

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?