What is the difference between Server.Transfer and
Response.Redirect? Why would I choose one over the other?

Answer Posted / sulochana singh

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 accros 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.
Response.Dedirect() :client know the physical location (page name and query string as well). Context.Items loses the persisitance when nevigate to destination page. In earlier versions of IIS, if we wanted to send a user to a new Web page, the only option we had was Response.Redirect. While this method does accomplish our goal, it has several important drawbacks. The biggest problem is that this method causes each page to be treated as a separate transaction. Besides making it difficult to maintain your transactional integrity, Response.Redirect introduces some additional headaches. First, it prevents good encapsulation of code. Second, you lose access to all of the properties in the Request object. Sure, there are workarounds, but they're difficult. Finally, Response.Redirect necessitates a round trip to the client, which, on high-volume sites, causes scalability problems. As you might suspect, Server.Transfer fixes all of these problems. It does this by performing the transfer on the server without requiring a roundtrip to the client.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i develop a web application and i gave security setting i.e autherization and athentication now it work properly on my local system , now question is ,is this security setting ie autherization and athentication which i gave in web.config will it be enough strong to secure my application on internet or i have to use some 3rd party tool or software to get security .if yes --how ? if no--what is the alternate?

1508


Why will you usually create an aspnet user account in the database for an asp.net web application?

537


What is event in asp.net?

534


What is the parent class of all web server control?

539


What is view state management in asp net?

461






How many types of triggers are there in update panel?

575


How to implement role based security in asp.net mvc? : Asp.Net MVC

435


How you will manage the state of ASP.NET controls?

570


Explain how viewstate is being formed?

540


What is http request and response?

533


What is the difference between the get method () and post method ()?

520


What is the difference between WindowsDefaultLocation and WindowsDefaultBounds?

671


What are the features that make asp.net more used framework? : asp.net mvc

544


How much is the pay-for-use service if I chose not to use microsoft-sponsored advertising?

509


What’s the catch?

623