$.ajax({
type: "get",
url: "ImformationBaseHandler.ashx",
data:"message="+result,
datatype: "Text",
async:false
});这个样可以传,后台设置断点也传到了,但
$.ajax({
type: "post",
url: "ImformationBaseHandler.ashx",
data:"message="+result,
datatype: "Text",
async:false
});
这个样子就传不了,后台设了断点,根本没走到断点的地方这是怎么回事?
type: "get",
url: "ImformationBaseHandler.ashx",
data:"message="+result,
datatype: "Text",
async:false
});这个样可以传,后台设置断点也传到了,但
$.ajax({
type: "post",
url: "ImformationBaseHandler.ashx",
data:"message="+result,
datatype: "Text",
async:false
});
这个样子就传不了,后台设了断点,根本没走到断点的地方这是怎么回事?
post的话 这样试试 。
var result = "测试";
$.ajax({
type: "post",
url: "ImformationBaseHandler.ashx",
data: "message=" + result,
datatype: "Text",
async: false,
success: function (ret) {
alert(ret);
},
error: function (ret) {
alert(ret);
}
});
</script><%@ WebHandler Language="C#" Class="ImformationBaseHandler" %>using System;
using System.Web;public class ImformationBaseHandler : IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
context.Response.Write(context.Request.Params["message"].ToString());
}
public bool IsReusable {
get {
return false;
}
}}