In general, for .NET everyone recommends using:
Response.Redirect("url", false)
instead
Response.Redirect("url", true)
to avoid race conditions, since the latter, apparently, suddenly stops the process.
Is there a case where it makes sense to use trueinstead false?
true
false
Is it also falsemore suitable than truewhen the redirect is not a back link to the same aspx page, but redirected to another aspx page?
true, , false, . ( , true , .)
, , ThreadAbortException, , , , . ASP.NET . , , .
ThreadAbortException
, , . return; Response.Redirect(). (.. , return; ), , , runaway, - .
return;
Response.Redirect()
, Response.Redirect() . , , #, . Response.Redirect() - , , , , .
false , Thread, / Response.Redirect().
, . Server
Server
true , / Response.Redirect() .
Of course you want to use Response.Redirect("url", false)if it is in a block try catch.
try catch
Otherwise, it will throw a ThreadAbortException.
try { Response.Redirect("url", false); } catch(Exception ex) { // Log exception }