???? ID: 312629 - ????? ???????: 29 ??????? 2010 - ??????: 4.0

PRB: ThreadAbortException Occurs If You Use Response.End, Response.Redirect, or Server.Transfer

?????? ??????This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
??? ?? ??????? ???? | ??? ?? ??????? ????

?????

??? ?? ?? ?????Response.End,Response.Redirect??,Server.Transfermethod, aThreadAbortExceptionexception occurs. You can use atry-catchstatement to catch this exception.

????

TheResponse.Endmethod ends the page execution and shifts the execution to theApplication_EndRequestevent in the application's event pipeline. The line of code that followsResponse.Endis not executed.

This problem occurs in theResponse.Redirect, ??Server.Transfermethods because both methods callResponse.Endinternally.

????????

To work around this problem, use one of the following methods:
  • ForResponse.End, call theHttpContext.Current.ApplicationInstance.CompleteRequest?? ???? ????Response.End??? ?? ???????? ?? ?????? ???? ?? ???Application_EndRequest??????
  • ?? ???Response.Redirect, ?? overload ?? ????? ????Response.Redirect (???????? url, bool endResponse)?? passesFALSE?? ???endResponse??? ???? ?? ??? ?????? ????? ???? ?? ??? ????????Response.End. ?????? ?? ???::
      Response.Redirect ("nextpage.aspx", false);
    						
    ??? ?? ?? ?????? ?? ?????, ??? ?? ????????Response.Redirect????????? ???
  • ?? ???Server.Transfer, ?? ????? ????Server.Execute???? ???? ????? ???

??????

?? ??????? ??????? ?????? ??..

???? ???? ???? ??:
  • Microsoft ASP.NET 1.1
  • Microsoft ASP.NET 1.0
??????: 
kbexcepthandling kbprb kbmt KB312629 KbMthi
???? ?????? ???????????? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:312629  (http://support.microsoft.com/kb/312629/en-us/ )