Header Ads

Server.Transfer vs Response.Redirect

Difference between Server.Transfer and Response.Redirect
ServerTransfervsResponseRedirect
Server.TransferResponse.Redirect
If you are using Server.Transfer then you can directly access the values, controls and properties of the previous pageBut you can’t do with Response.Redirect
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 changes the URL in the browser’s address bar. So they can be bookmarked.
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.Response.Redirect involves a roundtrip to the server.
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.Response.Redirect can be used to redirect a user to an external websites.
Server.Transfer can be used only for .aspx pages and is specific to ASP and ASP.NET.Response.Redirect can be used for both .aspx and html pages
For Ex:Server.Transfer(“newpage.aspx”)For Ex:Response.Redirect(“newpage.aspx”)



2 comments:

  1. I just started reading your blog! I really like it :) Followed!

    Check out my blog and follow if you like it :) developingcognition.blogspot.com

    ReplyDelete

Powered by Blogger.