asp.net ajax如何实现异步调用另一个页面

YiYanXiYin 2009-11-07 08:25:24
我想通过异步调用定时获取到另一个页面的内容,谢谢回复。
...全文
197 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
YiYanXiYin 2009-11-09
  • 打赏
  • 举报
回复
有就无需自己写脚本实现, 从而增加系统负担,很简单的道理, 何必过多评论, 有就有,没有就没有。
YiYanXiYin 2009-11-08
  • 打赏
  • 举报
回复
asp.net ajax那么强大的框架应该有这样的功能, 但一直没找到, 看来我只能自己创建 XMLHttpRequest对象了
YiYanXiYin 2009-11-08
  • 打赏
  • 举报
回复
我知道jq很方便, 但我的框架不能使用jq, 和jq不兼容, 所以问问asp.net ajax有无此功能
itliyi 2009-11-08
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 yiyanxiyin 的回复:]
<script  type= "text/javascript "  >
                var  xmlHttp
                function  createXMLHttpRequest()
                {
                        if(window.ActiveXObject)
                        {
                                xmlHttp  =  new  ActiveXObject( "Microsoft.XMLHTTP ");
                        }
                        else  if  (window.XMLHttpRequest)
                        {
                                xmlHttp  =  new  XMLHttpRequest();
                        }
                }

                function  startRequest()
                {
                        createXMLHttpRequest();
                        xmlHttp.onreadystatechange  =  handleStateChange;
                        xmlHttp.open( "GET ", "5534264.xml ",true);
                        xmlHttp.send(null);
                }

                function  handleStateChange()
                {
                        if(xmlHttp.readyState==4)
                        {
                                if(xmlHttp.status==200)
                                {
                                        alert( "服务器相应 "+xmlHttp.responseText);
                                }
                        }
                }

        </script>


asp.net ajax封装了这个功能么? 就是在客户端异步请求另一个页面?
[/Quote]都是封装惹的祸。。。
jjj666 2009-11-07
  • 打赏
  • 举报
回复
用PageMethod 也可以
YiYanXiYin 2009-11-07
  • 打赏
  • 举报
回复
我已经找了几天了,没找到asp.net ajax有这样的功能, 望知道的朋友告之一下, 不胜感激
YiYanXiYin 2009-11-07
  • 打赏
  • 举报
回复
<script type= "text/javascript " >
var xmlHttp
function createXMLHttpRequest()
{
if(window.ActiveXObject)
{
xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP ");
}
else if (window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
}

function startRequest()
{
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open( "GET ", "5534264.xml ",true);
xmlHttp.send(null);
}

function handleStateChange()
{
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
alert( "服务器相应 "+xmlHttp.responseText);
}
}
}

</script>



asp.net ajax封装了这个功能么? 就是在客户端异步请求另一个页面?
YiYanXiYin 2009-11-07
  • 打赏
  • 举报
回复
我找了半天一个都没找到
anyqu 2009-11-07
  • 打赏
  • 举报
回复
网上很多这样的例子,LZ搜下就可以了!为什么非要现成的呢?
Adechen 2009-11-07
  • 打赏
  • 举报
回复
参考Jquery的
$.ajax()
PEPSI_ICE 2009-11-07
  • 打赏
  • 举报
回复
学习
chen_ya_ping 2009-11-07
  • 打赏
  • 举报
回复
jquery这个我想很方便就可以实现你要求的功能,具体的资料可以参考网上的
happy664618843 2009-11-07
  • 打赏
  • 举报
回复
xmlHttp.open("Get","B.aspx",true);
xmlHttp.send(null)
B.aspx.cs
Response.Write("Hello");
接收B.aspx输入值
xmlHttp.responseText;
wangchunlin880210 2009-11-07
  • 打赏
  • 举报
回复
帮顶!
wuyq11 2009-11-07
  • 打赏
  • 举报
回复
在另一个页面通过httpwebrequest,WebRequest 获取页面内容,再传递
xml 可使用XmlTextReader等读取,再传递
xmlHttp.open( "GET ", "a.aspx",true);
YiYanXiYin 2009-11-07
  • 打赏
  • 举报
回复
pagemethod只能调用本页面的方法, 我要访问另一个页面的类容

62,074

社区成员

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

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

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

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