Showing posts with label true) Vs Response.Redirect(url. Show all posts
Showing posts with label true) Vs Response.Redirect(url. Show all posts

Tuesday, 3 January 2012

Response.Redirect(url,true) Vs Response.Redirect(url,false)

To avoid ThreadAbortException while Redirect

You don't need to put the redirect in a try-catch block. Just replace all calls to Response.Redirect(url) with the following two lines:

Response.Redirect(url, false);

That will avoid the exception being thrown and gracefully end execution of the thread and event chain.