What is the difference between Server.Transfer method and Response.Redirect method?
Usama Mosaad
Response.Redirect simply sends a message to the browser, telling it to move to another page.For Example:
Server.Transfer is similar in that it sends the user to another page:
For Example:
Server.Transfer("default.aspx").
Difference between Server.Transfer method and Response.Redirect method.
Response.Redirect should be used when:
Server.Transfer should be used when:
The Transfer method allows you to transfer from inside one ASP page to another ASP page. All of the state information that has been created for the first (calling) ASP page will be transferred to the second (called) ASP page. This transferred information includes all objects and variables that have been given a value in an Application or Session scope, and all items in the Request collections. For example, the second ASP page will have the same SessionID as the first ASP page. When the second (called) ASP page completes its tasks, you do not return to the first (calling) ASP page. All these happen on the server side browser is not aware of this. The redirect message issue HTTP 304 to the browser and causes browser to got the specified page. Hence there is round trip between client and server. Unlike transfer, redirect doesn’t pass context information to the called page.