急!!!放弃使用Ajax后页面间调用如何获取返回值

sicofield 2014-03-25 04:13:02
最近在做一个项目,需要将此项目中原来在aspx文件中的某个函数移至后台(aspx.cs文件)执行,原来的程序中使用了ajax技术
 Http.open("GET","./AjaxServer/RevertPhaseServer.aspx?pid="+productId+"&numid="+Math.random(),false); 
Http.setRequestHeader("Cache-Control","no-cache");
Http.send();
if( Http.responseText == "OK")
{
.........
}


在调用的页面中有
Response.Write(message);


现在修改代码后我使用
Server.Execute("./AjaxServer/RevertPhaseServer.aspx?pid="+productId)

来实现页面间跳转,但是Server.Execute如何获得返回值???是不是需用用别的方式来实现。包括修改被调用页面的代码。求大神帮助,谢谢!!!!分不多了只有25了。。。急啊!!
...全文
143 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
sicofield 2014-03-25
  • 打赏
  • 举报
回复
引用 1 楼 pengqian098 的回复:

Response.Write("./AjaxServer/RevertPhaseServer.aspx?pid="+productId)

 Http.open("GET","./AjaxServer/RevertPhaseServer.aspx?pid="+productId+"&numid="+Math.random(),false); 
 Http.setRequestHeader("Cache-Control","no-cache");
 Http.send();   
location.href = Http.responseText;
您好,原来的代码差不多就是用这种形式来写的,调用的页面中会有Response.Write() 现在我需要将你所列的上述代码写到aspx.cs文件中,就不能再用这种形式了,请问在aspx.cs文件中能用什么方式实现
跳动de指尖 2014-03-25
  • 打赏
  • 举报
回复

Response.Write("./AjaxServer/RevertPhaseServer.aspx?pid="+productId)

 Http.open("GET","./AjaxServer/RevertPhaseServer.aspx?pid="+productId+"&numid="+Math.random(),false); 
 Http.setRequestHeader("Cache-Control","no-cache");
 Http.send();   
location.href = Http.responseText;

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧