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

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - Emmet.C

[求助]关于Vsiual Studio.NET 2005中Error List种错误的定位问题 安装Tomcat 5.0.28备注 如何在运行时定制DataGrid的显示风格? asp.net中如何回车触发指定按钮的事件 Jbuilder2005安装备注 使用Singleton改善ASP.NET性能备注 Infragistics.WebUI.UltraWebTab.v4.3使用备注 WinForm界面模式 如何定制WebCarlendar类型控件的星期格式 .NET在Debug模式下的编译错误 DataGrid动态绑定 Infragistics UltraWebTab的奇怪问题 架构设计备注(用户以及操作权限管理) 关于通过手机收发短信的相关资源 Read CPU ID(from CSDN) 可用性相关的资料站点 万网企业邮箱开始提供垃圾邮件过滤功能了 为何使用表格排版是不明智的? 申请了GMail
【求助】关于asp.net中的'Thread was being aborted'异常
Emmet.C · 2006-02-15 · via 博客园 - Emmet.C

Posted on 2006-02-15 10:18  Emmet.C  阅读(6326)  评论()    收藏  举报

大家知道在asp.net下Server.Transfer和Response.Redirec做着相似的事情却存在很大的区别。
其中一个区别在于response.redirect会重新发起一次请求,因此,会将当前请求的进程abort掉。所以,每次使用response.redirect方法都会抛出一个'Thread was being aborted'的异常。我查阅的相关的资料认为解决这个问题的最好办法是不要把response.redirect写在try/catch以内,那就不会出现这个异常了。
现在情况是,我需要在程序中通过点击触发response.redirect方法来转到特定的页面(类似于abc.aspx?par1=1&par2=demopar),但是每次都会出现'Thread was being aborted'异常,我在页面捕获异常并转到错误处理页面。奇怪的是,这个异常是间隔出现的,也就是说,我点第一次,转到错误处理页面,我点第二次,正常处理,第三次,错误处理页面,第四次,正常处理。根据跟踪数据表明,每次都抛出了这个异常。所以我很 奇怪为什么会出现这种间隔处理的情况。
为了解决这个问题,我依照网上的建议,将redirect方法放置在try/catch之外,结果的确没有异常了,服务器返回给我一个完全空白的页面。感觉就像当前请求还是被abort掉了,但是由于我并没有捕获这个异常,所以页面也没有任何输出。

很多人也许奇怪我为什么不用transfer,最大的一个原因在于使用transfer页面标题不会改变,而且现有机制如果改用transfer会变动较大。

那位大大知道怎么办?谢谢。