ASP.net页面中的System.Threading.ThreadAbortException

3

我在ASP.net页面中有以下代码:

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

上面的代码会抛出 "发生了类型为 'System.Threading.ThreadAbortException' 的异常并被捕获"。

有人能告诉我原因吗?我该如何解决这个问题。

谢谢。


2
请阅读以下链接:https://dev59.com/B3NA5IYBdhLWcg3wHp-B 及相关的知识库文章:http://support.microsoft.com/kb/312629。 - Tim M.
1个回答

1

在页面的任何子对象中调用Response.End()很可能会导致“System.Threading.ThreadAbortException”异常。

请阅读this,了解为什么会发生这种情况以及避免/处理异常的方法的完整说明。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接