When you redirect to another page using .NET, you normally use the Response.Redirect method. However, if you only supply the URL as the parameter, you'll get a ThreadAbort exception thrown. This can fill the event log pretty darn quick. To avoid this, set the second parameter to False. This will immediately end the response, so no exception is thrown.
The only "exception" to this rule (haha), is when you want code to execute after the Response.Redirect. In this case you can't immediately end the response. In this case, you either have to put up with the exceptions in the log, or catch the ThreadAbort exception and just swallow it.
No comments:
Post a Comment