|
|
submitted by
wisemx
6 months, 11 days ago
blogs.msdn.com — Server.Transfer and Response.Redirect are causing a new page to be processed, but the big difference is how they are doing it.
- Server.Transfer terminates the execution of the current request (Response.End) and begins execution of a new request using the supplied url. No trip back to client is performed.
- Respose.Redirect creates a special header, sends it to the client to ask the server for a different page.
o Response.Redirect(url) == Response.Redirect(url, true). In this case, right after creating the header, the page execution is done – Response.End is called, and this one causes the current thread to be aborted (ThreadAbortException will be thrown).
o Response.Redirect(url, false) doesn’t abort the thread, so it is recommended because it avoids the exceptions. This form is used for example by FormsAuthentication.RedirectFromLoginPage method.
read more...
add a comment
|
category: ASP.NET | Views: 8
|
|
tags:
redirect, Server.Transfer, ASP.NET | tag it
Everyones tags: | Your tags: | |
|
|
|