Home > ASP.NET, Tips & Tricks > Server.Transfer v/s Response.Redirect

Server.Transfer v/s Response.Redirect


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

  • Response.Redirect involves a roundtrip to the server whereas Server.Transfer conserves server resources by avoiding the roundtrip. It just changes the focus of the webserver to a different page and transfers the page processing to a different page.
  • If you are using Server.Transfer then you can directly access the values, controls and properties of the previous page which you can’t do with Response.Redirect.
  • Response.Redirect changes the URL in the browser’s address bar. So they can be bookmarked. Whereas 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.
  • Response.Redirect can be used to redirect a user to an external websites. Server.Transfer can be used only on sites running on the same server. You cannot use Server.Transfer to redirect the user to a page running on a different server.
Advertisements
Categories: ASP.NET, Tips & Tricks
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: