使用Web服务在ASP页面之间导航 [英] Navigating between asp pages using webservices

查看:122
本文介绍了使用Web服务在ASP页面之间导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用Web服务从一个页面导航到另一页面.我尝试使用以下代码-HttpContext.Current.Response.Redirect("mypage.aspx");并显示以下错误-无法优化表达式,因为代码已优化或本机框架位于调用堆栈的顶部.提前致谢.希望得到尽快答复

解决方案

要代替HttpContext.Current.Response.Redirect("mypage.aspx");,您必须使用HttpContext.Current.Response.Redirect("mypage.aspx", false);方法来禁止对Response.End的内部调用.
在此处查看详细信息: Microsoft支持:如果您使用Response.End,Response.Redirect或Server.Transfer,则会发生ThreadAbortException [ ^ ]

I''m unable to navigate form one page to another using web services. I tried Using the following code - HttpContext.Current.Response.Redirect("mypage.aspx"); and it is showing the following error- Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack. Thanks In Advance. Expecting a reply ASAP

解决方案

In place of HttpContext.Current.Response.Redirect("mypage.aspx"); you have to use HttpContext.Current.Response.Redirect("mypage.aspx", false); method to suppress the internal call to Response.End.

Look here for details: Microsoft Support: ThreadAbortException Occurs If You Use Response.End, Response.Redirect, or Server.Transfer[^]


这篇关于使用Web服务在ASP页面之间导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆