客户端请求后台代码

首先config文件配置中
 <httpHandlers>
      <add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>
</httpHandlers>

接着在页面的load事件中注册
 Ajax.Utility.RegisterTypeForAjax(typeof(_Default));//_Default为Default.aspx页面

然后写代码函数,函数前要声明Ajax
 [Ajax.AjaxMethod(HttpSessionStateRequirement.ReadWrite)]
 public string GetInfo(string id){}//返回类型只能用string void bool

最后是引用Ajax.DLL

Download Ajax.dll from FileFactory.com

posted @ 2009-06-03 18:16  吥滅傳說  阅读(170)  评论(0编辑  收藏  举报