Skip Navigation Links
技术文档
·网站建设
·软件使用
·图形设计
·程序开发
·网络应用
·电脑技巧
 
公司介绍
·公司简介
·索仕SRCOS网络应用平台
·索仕网站管理系统
·影视广告制作
·联系我们
 
 

由于代码已经过优化或者本机框架位于调用堆栈之上,无法计算表达式的值

7/19/2010 9:47:31 PM

 

    因为对 Response.End()、Response.Redirect("xxx.html") 和 Server.Transfer("xxx.html") 的调用在当前响应提前结束时引发一个 ThreadAbortException。

使用Response.Redirect("xxx.html",false)或 
try 

Response.Redirect("regok.aspx",false); 

catch (System.Threading.ThreadAbortException e) 

throw; 
}  

 

Response.End 方法停止页的执行,并将该执行变换到应用程序的事件管线中的 Application_EndRequest 事件,Response.End 后面的代码行将不执行。此问题出现在 Response.Redirect 和 Server.Transfer 方法中,这是由于这两种方法都在内部调用 Response.End
   
   相应的解决办法如下:
(1)   对于 Response.End:
   调用 ApplicationInstance.CompleteRequest 方法而不调用 Response.End,以便跳过 Application_EndRequest 事件的代码执行。

(2)   对于Response.Redirect:
   使用重载 Response.Redirect(String url, bool endResponse),对 endResponse 参数它传递 false以取消对 Response.End 的内部调用。例如: 
Response.Redirect ("nextpage.aspx", false);
如果使用这种解决方法,Response.Redirect 后面的代码将得到执行。

(3)   对于 Server.Transfer:
   请改用 Server.Execute 方法。

 
 
 
昆明索仕科技开发有限公司 版权所有 Copyright© 2002-2010 Kunming Source Technology Exploitive Co.,LTD. All Rights Reserved.
电话:0871-5627877 业务QQ:163871 联系我们
本站基于:索仕网站信息管理系统建设 版本 2.0.4325