易截截图软件、单文件、免安装、纯绿色、仅160KB

简单的AJAX手工范例

Client端
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
  <script language="javascript">
  var XmlHttp=new ActiveXObject("Microsoft.XMLhttp");
  
  function sendAJAX()
  {
   XmlHttp.Open("POST","Server.aspx",true);
   XmlHttp.send(null);
   XmlHttp.onreadystatechange=ServerProcess;
  }
  
  function ServerProcess()
  {
   if (XmlHttp.readystate==4 || XmlHttp.readystate=='complete')
   {
    document.getElementById('nameList').innerHTML =XmlHttp.responsetext;
   }
  }
  
  setInterval('sendAJAX()',1000);
  
  </script>
 </head>
 <body>
  <div id="nameList"></div>
 </body>
</html>
另建一页面Server.aspx,Server端
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Diagnostics;
public partial class Server : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        PerformanceCounter myMemory = new PerformanceCounter();
        myMemory.CategoryName = "Memory";
        myMemory.CounterName = "Available KBytes";
        string txtResult = "-->服务器可用内存大小:" + myMemory.NextValue().ToString();
        Response.Write(DateTime.Now.ToLongTimeString() + txtResult);
    }
}
Syst


相关文档:

AJAX Follow Me

最近网上提的很多的一个新概念就是 AJAX 了, 那么, AJAX 是什么呢? 以下内容引用网上资料:
AJAX全称为“Asynchronous JavaScript and XML”(异步JavaScript和XML),是指一种创建交互式网页应用的网页开发技术。它有机地包含了以下几种技术:
Ajax(Asynchronous JavaScript + XML)的定义
基于 web标准(sta ......

ASP.NET AJAX 服务器端编程学习小结

    最近开始了ASP.NET AJAX的全面学习。在服务端编程这块主要有几个服务器控件负责,他们分别为:ScriptManager,Timer,UpdatePanel,UpdateProgress.
     先来说说ScriptManager.它有个方法registerAsyncPostBackControl(控件),可以注册页面上的任何控件为异步传送按钮。还有个方法叫 ......

Ajax传参乱码 Ajax中文乱码

                      Ajax传参乱码 Ajax中文乱码 解决
在Ajax url传参时出现中文乱码的情况,解决方法:
    例1:  xmlHttp.open("GET","Engine.aspx?Action=getmainsort&Type= ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号