1、修改web.config 在system.web节点下添加 以下为引用的内容: <system.web> <httpHandlers> <add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/> </httpHandlers> 2、将你的.NET方法添加AjaxMethod属性 以下为引用的内容: [AjaxPro.AjaxMethod] public DateTime GetServerTime() { return DateTime.Now; } 3、在.NET方法中向客户端注册javascript,用以javascript使用 以下为引用的内容: namespace MyDemo { public class _Default { protected void Page_Load(object sender, EventArgs e) { AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default)); } [AjaxPro.AjaxMethod] public DateTime GetServerTime() { return DateTime.Now; } } } 4、在客户端用javascript调用服务器端的方法,语法也很简单 以下为引用的内容: function getServerTime() { MyDemo._Default.GetServerTime(getServerTime_callback); // asynchronous call } // This method will be called after the method has been executed // and the result has been sent to the client. function getServerTime_callback(res) { alert(res.value); }