Performance-wise, there is a difference. Because Request.Redirect is a request to the browser to go to another page, it involves an extra roundtrip. Depending on how fast or slow your Internet connection is, this extra trip can add a pause of a second or two while the browser fetch the new page. With Server.Transfer, the redirected page appears immediately in lieu of the originally requested page.
I have to admit, I'm beginning to be a bit of a fan of Server.Transfer. But most programmers don't seem to like it based on other blog posts. They say that its an old API that should not be used anymore. One of its disadvantages is that it will not allow the user/browser to bookmark a page since it does not know the actual url of the redirected page.
With .NET, passing parameters from one webpage to another using Server.Transfer requires the use of the Context objects. With Request.Redirect, the practice is to just use the more common Session object. Truth be told, I really don't understand what is the difference between those two object types. PayEasy uses a combination of both.
No comments:
Post a Comment