为什么在执行Server.Transfer()时会出现异常...
Server.Transfer(@"~/Student/StudentSendMail.aspx?username=" + username);
{Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}发布于 2009-08-09 20:01:42
这个奇怪的错误消息的一个原因是在try-catch块中执行Server.Transfer。有几种方法可以解决这个问题:
1)添加第二个参数集为false,如下所示:
Server.Transfer(@"~/Student/StudentSendMail.aspx?username=" + username, false);2)捕获类型为System.Threading.ThreadAbortException的异常,并且在Catch块中什么也不做,因此该异常被忽略
3)将Server.Transfer移至Finally块
发布于 2009-08-09 18:48:03
请查看以下链接
http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/76bbff0a-da87-4150-a3d1-2a9372e73d81
http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/817776da-13da-43f5-a189-1727ce4f3b6b
http://blogs.msdn.com/jmstall/archive/2005/11/15/funceval-rules.aspx
https://stackoverflow.com/questions/1251927
复制相似问题