在ASP.net页面“System.Threading.ThreadAbortException” [英] 'System.Threading.ThreadAbortException' in ASP.net page

查看:125
本文介绍了在ASP.net页面“System.Threading.ThreadAbortException”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的ASP.net页面的下方code:

I have the below code in my ASP.net page:

Response.StatusCode = 404
Response.Write(strResult)
Response.End()

在code以上抛出类型System.Threading.ThreadAbortException的异常发生,并且被抓住了。

The code above throws "An exception of type 'System.Threading.ThreadAbortException' occurred and was caught."

谁能告诉我为什么?而且我解决这个问题。

Can anyone tell me the reason why? And do I solve this.

感谢

推荐答案

调用到Response.End()从页面的任何子对象将最有可能导致系统.Threading.ThreadAbortException'例外。

Calling Response.End() from any child object of the page will most likely cause the 'System.Threading.ThreadAbortException' exception.

请阅读这个对于为什么这样一个完整的交代正在发生的事情和方法,以避免/处理异常。

Please read this for a full explaination of why this is happening and methods to avoid/deal with the exception.

这篇关于在ASP.net页面“System.Threading.ThreadAbortException”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆