1 July 2011

Server.Transfer v/s Response.Redirect in asp.net

Server.Transfer v/s Response.Redirect in asp.net

-Both these are used to transfer one page to another page in asp.net.

-Response.Redirect(“newpage.aspx”) and Server.Transfer(“newpage.aspx”)

Difference between Server.Transfer and Response.Redirect in asp.net

- Response.Redirect sends the request for the new page to the browser then browser
sends the request for the new page to the webserver.
- but in the case of Server.Transfer it directly communicate with the server to change
the page hence it saves a roundtrip in the whole process.
-If you are using Server.Transfer then you can directly access the values,
controls and properties of the previous page
-But in Response.Redirect, it is not possible.

-Server.Transfer retains the original URL in the browser’s address bar.
It just replaces the contents of the previous page with the new one.
-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.


No comments:

Post a Comment

Comments Welcome

Implementing OAuth validation in a Web API

 I mplementing OAuth validation in a Web API Implementing OAuth validation in a Web API using C# typically involves several key steps to sec...