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

推荐订阅源

W
WeLiveSecurity
T
Troy Hunt's Blog
S
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
C
CXSECURITY Database RSS Feed - CXSecurity.com
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Security Latest
Security Latest
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MyScale Blog
MyScale Blog
Recorded Future
Recorded Future
A
About on SuperTechFans
PCI Perspectives
PCI Perspectives
H
Help Net Security
量子位
Blog — PlanetScale
Blog — PlanetScale
云风的 BLOG
云风的 BLOG
S
Security @ Cisco Blogs
The Hacker News
The Hacker News
P
Privacy International News Feed
Hacker News: Ask HN
Hacker News: Ask HN
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
N
Netflix TechBlog - Medium
N
News and Events Feed by Topic
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Threatpost
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Simon Willison's Weblog
Simon Willison's Weblog
有赞技术团队
有赞技术团队
博客园 - 司徒正美
J
Java Code Geeks
S
Securelist
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Security Archives - TechRepublic
Security Archives - TechRepublic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 叶小钗
S
Secure Thoughts
Latest news
Latest news
S
Security Affairs
T
The Exploit Database - CXSecurity.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
I
Intezer
雷峰网
雷峰网
Hacker News - Newest:
Hacker News - Newest: "LLM"
Engineering at Meta
Engineering at Meta
Hugging Face - Blog
Hugging Face - Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org

博客园 - 不搽雪花膏

linux网关设置 <!DOCTYPE>标签与table高度100% (转) linux运行apache出现403错误 Ubuntu 12.10 Tty (字符终端) 显示中文,和字体大小设置 64位系统下组件服务的查看 ActiveRecord返回部分字段的查询 转 Web前端性能优化全攻略 Castle ActiveRecord 笔记 - 不搽雪花膏 WQL测试工具 [转载]HttpModule与HttpHandler详解 转载 云计算七问七答 [转]整理.net程序集加载方法 MySQL(5.0)导出导入 .NET代码编写规范 Hibernate配置参数 [转]PKCS 证书 细数.net3.0的各项新特性 Jquery示例 Jquery入门
[转]Response.End、Response.Redirect 或 Server.Transfer 方法与 ThreadAbortException 异常
不搽雪花膏 · 2008-05-06 · via 博客园 - 不搽雪花膏

源文: http://blog.csdn.net/hanzhongzheng/archive/2007/11/11/1878838.aspx

症状

如果使用 Response.EndResponse.RedirectServer.Transfer 方法,将出现 ThreadAbortException 异常。您可以使用 try-catch 语句捕获此异常。

原因

Response.End 方法终止页的执行,并将此执行切换到应用程序的事件管线中的 Application_EndRequest 事件。不执行 Response.End 后面的代码行。

此问题出现在 Response.RedirectServer.Transfer 方法中,因为这两种方法均在内部调用 Response.End

解决方案

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

对于 Response.End,调用 HttpContext.Current.ApplicationInstance.CompleteRequest 方法而不是 Response.End 以跳过 Application_EndRequest 事件的代码执行。
对于 Response.Redirect,请使用重载 Response.Redirect(String url, bool endResponse),该重载对 endResponse 参数传递 false 以取消对 Response.End 的内部调用。例如:
  Response.Redirect ("nextpage.aspx", false);
            
如果使用此替代方法,将执行 Response.Redirect 后面的代码。
对于 Server.Transfer,请改用 Server.Execute 方法。

状态

这种行为是设计导致的。

http://blog.csdn.net/hanzhongzheng/archive/2007/11/11/1878838.aspx