Error!
Success!

Server.Transfer / Response.Redirect

0
kicks

Server.Transfer / Response.Redirect  (Unpublished)

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.


Kicked By:
Drop Kicked By: