格古洛

记下遇到的一些问题,或许以后还用得着

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

在try catch中使用Response.End()抛"线程被中止"异常,Response.Redirect()和Server.Transfer()也会出现这个问题.

如:(

Code

)

 

如果不用catch (System.Threading.ThreadAbortException ex),就会抛"线程被中止"异常,

如果不用catch (System.Threading.ThreadAbortException ex),而用HttpContext.Current.ApplicationInstance.CompleteRequest 代替Response.End(),则后面的DoOtherThing()还是会继续执行.

要根据实际需要选择具体做法.

posted on 2009-05-12 22:00  格古洛  阅读(1161)  评论(5编辑  收藏  举报