日期:2014-05-16  浏览次数:20349 次

jquery ajax ##############
 public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        string action = context.Request.Params["action"];
        if (!string.IsNullOrEmpty(action))
        {
            this.GetType().GetMethod(action).Invoke(this, new object[] { context });
        }
        else
        {
            context.Response.End();
        }
       

    }

    public void ABC(HttpContext context)
    {
        string name = context.Request["Name"].ToString();
        string sex =context.Request.Form["Sex"].ToString();
        context.Response.Write(name + "|" + sex);
   
    }
    public void WER(HttpContext context)
    {
        string name = context.Request["Name1"].ToString();
        string sex = context.Request.Form["Sex1"].ToString();
        context.Response.Write(name + "|" + sex);

    }


 上面是一般处理程序中的代码, 求解!
------解决方案--------------------

var url="";//表示你一般处理程序的地址
var param = {action:"ABC",name:"tom",sex:18};//这里表示传参,调用ABC方法
$.post(url,param,function(data){
alert(data);//显示返回的数据
});//这里使用ajax的post请求