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 server, transfer and response and redirect?

user-image
Question ajoutée par Asif Ali , Software Engineer , BroadPeak Technologies
Date de publication: 2013/08/06
Shahzad Khan
par Shahzad Khan , Sr. Software Developer , Mar Incorporated

Both methods redirect user to a different page. Response.Redirect does a round trip between browser and server and you are able to see new URL in your browser. Server.Transfer is a server side action where browser is totally unaware of new URL but able to render new page.

Faisal Shah
par Faisal Shah , Senior Web Architect , Innomar Strategies Inc

In addition, there is a slight trick when it comes to AJAX. Response.Redirect can be problematic in that scenario

Anshul Tiwari
par Anshul Tiwari , Software Developer , RTSPL

In earlier versions of IIS, if we wanted to send a user to a new Web page, the only option we had was Response.Redirect. While this method does accomplish our goal, it has several important drawbacks. The biggest problem is that this method causes each page to be treated as a separate transaction. Besides making it difficult to maintain your transactional integrity, Response.Redirect introduces some additional headaches. First, it prevents good encapsulation of code. Second, you lose access to all of the properties in the Request object. Sure, there are workarounds, but they're difficult. Finally, Response.Redirect necessitates a round trip to the client, which, on high-volume sites, causes scalability problems. As you might suspect, Server.Transfer fixes all of these problems. It does this by performing the transfer on the server without requiring a roundtrip to the client.

More Questions Like This

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