我们如何在ASP .net中使用ajax [英] how we use ajax with ASP .net

查看:64
本文介绍了我们如何在ASP .net中使用ajax的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过.net

解决方案

尝试 google [ ^ ]



http://www.asp.net/ajax/ajaxcontroltoolkit/samples/ [ ^ ]



http://ajax.net-tutorials.com/ [ ^ ]


最新支持AJAX的ASP.NET将支持通过提供框架支持来使用AJAX。从中你需要下载AJAX控件工具包 - 一个集合支持ajax的控件。


 <  !DOCTYPE     html  >  
< ; html >
< head >
< script >
function loadXMLDoc()
{
var xmlhttp;
if(window.XMLHttpRequest)
{//代码用于IE7 +,Firefox,Chrome,Opera,Safari
xmlhttp = new XMLHttpRequest();
}
else
{// IE6的代码,IE5
xmlhttp = new ActiveXObject(Microsoft.XMLHTTP);
}
xmlhttp.onreadystatechange = function()
{
if(xmlhttp.readyState == 4&& xmlhttp.status == 200)
{
document.getElementById(myDiv)。innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open(GET,ajax_info.txt,true);
xmlhttp.send();
}
< / script >
< / head >
< body >

< div < span class =code-attribute> id = myDiv > < h2 > 让AJAX更改此文本< / h2 > < / div >
< 按钮 type = 按钮 onclick = loadXMLDoc() > 更改内容< / button >

< / body >
< / html >


any link which gives me help about ajax control with .net

解决方案

try google[^]

http://www.asp.net/ajax/ajaxcontroltoolkit/samples/[^]

http://ajax.net-tutorials.com/[^]


The latest AJAX enabled ASP.NET will supports to use the AJAX by providing framework support.Appart from that you have to download AJAX control toolkit - a collection of controls that supports the ajax.


<!DOCTYPE html>
<html>
<head>
<script>
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","ajax_info.txt",true);
xmlhttp.send();
}
</script>
</head>
<body>

<div id="myDiv"><h2>Let AJAX change this text</h2></div>
<button type="button" onclick="loadXMLDoc()">Change Content</button>

</body>
</html>


这篇关于我们如何在ASP .net中使用ajax的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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