+ Reply to Thread
Results 1 to 2 of 2

Thread: Response.End() throws ThreadAbortException exception

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    3

    Response.End() throws ThreadAbortException exception

    I am using Response.End() to terminate execution and send the response back.
    But it throws ThreadAbortException exception. How can I avoid it?

  2. #2
    Junior Member
    Join Date
    Oct 2012
    Posts
    6
    The Response.End method ends the page execution and shifts the execution to the Application_EndRequest event in the application's event pipeline. The line of code that follows Response.End is not executed. But it will throw exception.

    To solve this call the HttpContext.Current.ApplicationInstance.CompleteRe quest method instead of Response.End to bypass the code execution to the Application_EndRequest event.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts