• HTTP重定向出现“正在中止线程”问题


    Response.Redirect 产生的“正在中止线程”错误,将出现 ThreadAbortException 异常。
    原因:
    Response.End 方法终止页的执行,并将此执行切换到应用程序的事件管线中的 Application_EndRequest 事件。不执行 Response.End 后面的代码行。 此问题出现在 Response.Redirect 和 Server.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 (“MicroscopeList.aspx”, false);

  • 相关阅读:
    xshell 缺少mfc110u.dll
    notepad++ 常用插件
    java 发送 http post 和 get 请求(利用unirest)
    my.conf配置大全
    md5算法
    sprinboot+redis
    jq下拉插件,chosen
    springboot+idea 热部署
    Jquery 监听浏览器前进后退
    手机自带的表情入库
  • 原文地址:https://www.cnblogs.com/itjeff/p/16405349.html
Copyright © 2020-2023  润新知