Quick tip: Troubleshoot Response.Redirect() in a try/catch clause

If you have a Responce.Redirect(“urlToNavigateTo”) method in your try section of a try/catch clause, you will notice that the debugger falls into the catch section as it fails to complete the try part of the clause.

What you need to do in such a situation is to call the Redirect() with a false boolean to define that the application should not terminate the execution of the page.

ie. Response.Redirect(“urlToNavigateTo”, false);

MGR: the Intelogist

About MGR: the Intelogist

SharePoint Server developer, turned Sitefinity developer, turned Angular developer, turned SharePoint Online consultant, turned Unily consultant, turned O365 consultant... Never a dull moment!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.