Hi
I know there is several ways to change the current page in ASP.Net. So, by Redirecting to a new page, what will happen to the thread we were running it in the prev. page?
Hi
I know there is several ways to change the current page in ASP.Net. So, by Redirecting to a new page, what will happen to the thread we were running it in the prev. page?
The Response.Redirect
method uses an exception to exit out of the current page creation cycle, and sends a redirection page back in the response to the browser. The thread then finishes off the Page
object and returns to the pool just like when a regular page is complete. The browser handles the redirection page and sends a new request to the server, so the redirected page is a completely new request that has no direct relation to the first request.
The Server.Transfer
method will end the current page execution and continue with the target page without doing a round trip to the server.
The Server.Execute
method will execute the target page, then return to continue the rest of the code in the original page.