In ASP.NET I frequently use Response.Redirect to redirect the end user to another page on my system. I always set the second parameter to true to immediately end the response.
For the life of me, I can't think of a reason why anybody would ever set that parameter to false. What's the point of continuing generating a page when the end user's browser is just going to be redirected to a different page immediately?
Response.Redirect
does not mean that The Page-lifecycle has ended on the server, it just sends a header to the client.
Perhaps you want to redirect the user first and THEN save his large amount of uploaded data to the database?
HttpServerUtility.Transfer
by the way does terminate the Page-lifecycle, but it does not send a header, it simply serves a different page.
Response.Redirect(..., true);
client will be sent the redirect for the new page, processing will stop as a thread abort will occur
Response.Redirect(..., false);
client will be sent the redirect for the new page, current page will be allowed to continue processing, perhaps some cleanup work to do or something else
client will never see the results from current page in either cases
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With