Try-catch 中的 Server.Transfer : 线程中止异常
等效
Response.Redirect("abc.aspx",false)
于我使用server.trans.trans.redirect.i false用作响应的第二个参数。redirect停止在尝试捕获块中停止接收螺纹bot型异常,
我想摆脱线程。当我在尝试捕获块中使用server.transferis时。有什么想法吗?
What is the equivalent of
Response.Redirect("abc.aspx",false)
when i use Server.Transfer instead of Response.Redirect.I use false as the second param of Response.Redirect to stop receiving the ThreadAbort exception in a try catch block
I want to get rid of the Thread.Abort exception when i use Server.Transferis in a try catch block. Any thoughts ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请改用
Server.Execute
。正如将 false 传递给 Response.Redirect 一样,您必须确保在执行您所在方法(及其调用方法)中的其余代码时不会发生任何不良情况。Use
Server.Execute
instead. Just as with passing false toResponse.Redirect
, you have to make sure that nothing undesirable happens when the rest of the code in the method you are in (and its calling methods) is executed.