response.Transfer And response.Redirect
What is difference between response.redirect and response.Transfer in Asp .net?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tuhin PaulPosted Feb 28, 2023, 3:39 AM
The key differences between the two methods are:
In general, Response.Redirect is more commonly used than Server.Transfer.
Rajeev KumarPosted Feb 27, 2023, 7:10 AM
Response.Redirect uses Roundtrip It means it send a response to the client and directs the client (the browser) to load the new page .Server.Transfer transfers execution directly to another page.. If you don't need to execute code on the client, Transfer is more efficient.
Satyapriya NayakPosted Oct 1, 2012, 12:38 AM
Response.Redirect sends a response to the client browser instructing it to request the second page. This requires a round-trip to the client, and the client initiates the Request for the second page. Server.Transfer transfers the process to the second page without making a round-trip to the client. It also transfers the HttpContext to the second page, enabling the second page access to all the values in the HttpContext of the first page
Server.Transfer: client is shown as it is on the requesting page only, but the all the content is of the requested page. Data can be persist across the pages using Context.Item collection, which is one of the best way to transfer data from one page to another keeping the page state alive.
Server.Transfer transfers execution directly to another page. Response.Redirect sends a response to the client and directs the client (the browser) to load the new page (it causes a roundtrip). If you don't need to execute code on the client, Transfer is more efficient.
Thanks