惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
Tenable Blog
Project Zero
Project Zero
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
S
Schneier on Security
Scott Helme
Scott Helme
S
Securelist
Know Your Adversary
Know Your Adversary
Vercel News
Vercel News
IT之家
IT之家
V
V2EX
F
Fortinet All Blogs
Simon Willison's Weblog
Simon Willison's Weblog
K
Kaspersky official blog
博客园_首页
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
Spread Privacy
Spread Privacy
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
有赞技术团队
有赞技术团队
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
L
LINUX DO - 热门话题
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
S
SegmentFault 最新的问题
AWS News Blog
AWS News Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost

博客园 - 笨笨丁

IIS启用兼容模式设置(win2k3—Win7) C#调用java类、jar包方法(转) 解决VML遭遇IE8和XHTML DOCTYPE时不能运行的问题(转) Nice Validator(Form验证)及Juery zTree控件 SQL语句Where中使用别名作为判断条件 50个令人惊奇的jQuery插件(对话框和表单篇)及免费的响应式bootstrap管理员后台界面主题 - Charisma PowerDesigner设计时表显示注释选项 showModalDialog 的重要提示 在网页中怎样给已发布的Flash添加链接的方法(zhuan) ASP.NET网站中获取当前虚拟目录的应用程序目录的方法(转) __doPostBack()没有定义解决方法(转) jQuery插件实战之fullcalendar(日历插件) - 使用fullcalendar开发一个功能完整的富客户端会议室预定系统(转) ajaxpro返回值类型总结-DataTable(转) Ibatis.net总是报:【ExecuteStoreCommand SqlParameterCollection 中已包含 SqlParameter】(转) jQuery校验validate详解(转) 一个.NET通用JSON解析/构建类的实现(c#)转 C# JSON字符串序列化与反序列化(转) AjaxPro新发现-错误处理 SVN专题:SVN Client API的.net 接口 SharpSvn介紹 Checkout操作实例,SVN权限(转)
ASP.NET程序中 抛出"Thread was being aborted. "异常(转)
笨笨丁 · 2013-10-17 · via 博客园 - 笨笨丁

Thread was being aborted :中文意思 线程被终止

引用地址:http://support.microsoft.com/default.aspx/kb/312629/EN-US/?p=1

原因:

那个 Response.End 方法结束页的执行,并转移到执行 的Application_EndRequest 事件在应用程序的事件管道。该行的代码如下 Response.End 不会被执行。
此问题出现在 Response.RedirectServer.Transfer方法 方法,因为这两种方法调用 Response.End 在内部。

解决方案:

若要解决此问题,请使用下列方法之一:

  • 为了 Response.End,调用 HttpContext.Current.ApplicationInstance.CompleteRequest 方法,而不是 Response.End 绕过的代码执行 的Application_EndRequest 事件。

try{

HttpContext.Current.Response.ContentEncoding = utf;
           HttpContext.Current.Response.Write(style);
           HttpContext.Current.Response.Write(sb.ToString());
           //HttpContext.Current.Response.End();

}
catch{}
finally
{
System.Web.HttpContext.Current.ApplicationInstance.CompleteRequest();
}

  • 为了 Response.Redirect,使用过载, Response.Redirect(string URL,bool endResponse) 的推移 false endResponse 参数压制内部电话 Response.End。例如:
      Response.Redirect(“nextpage.aspx”,false);
    						

    如果您使用此解决方案,下面的代码 Response.Redirect 被执行。

  • 为了 Server.Transfer方法,使用 使用Server.Execute 方法来代替。

另:尽量不要把Response.Redirect("targetUrl");语句写在try里面了! 使用Response.Redirect("targetUrl",false);