ajax代码
$.ajax({
type: "post",
url: "AjaxHandler.ashx",
data: {"value1":'万事如意',"value2":'心想事成',"value3":'牛牛牛'}, //参数要对应
success: function(result) {
alert(result);
}
});
一般处理程序操作ashx
获取参数值
string value1 = context.Request.Form["value1"] ?? "";
string value2 = context.Request.Form["value2"] ?? "";
string value3 = context.Request.Form["value3"] ?? "";
调用操作方法 并返回值
context.Response.Write(GetString(str));