Issue :'Thread is being aborted' when using Response.Redirect
FIX: If you want to get rid of this exception, use Response.Redirect(url, false).
Cause explanation:
Your page is executing by a thread on which asp.net worker process contains. And on some line in your code, an instruction (Response.Redirect) wants to stop the execution because it must be stopped and asp.net framework must be notified about a redirection request.
Asp.net framework catches the Redirect method's exception, aborts the thread and use a new thread for execution of to be redirected page.
This occurs when you specify the second argument of Redirect method as True. Because this means to asp.net framework as 'Stop this page's execution ASAP and execute to be redirected page'.
Ref:http://p2p.wrox.com/asp-net-1-0-1-1-basics/5684-thread-being-aborted.html
Subscribe to:
Post Comments (Atom)
Devops links
Build Versioning in Azure DevOps Pipelines
-
Build Versioning in Azure DevOps Pipelines
-
Don't use FirstorDefault() unless you are sure its valid/ verified in the business scenario. else you are going to introduce bugs in t...
-
Some tools which help this development 1. The WMI Code Creator tool allows you to generate VBScript, C#, and VB .NET code that us...
No comments:
Post a Comment