script language="javascript" type="text/javascript">
$(function () {
$("a").click(function () {
$.ajax({
url: "Handler.ashx",
data: { "PageIndex": "helloword" }, // data: { "message": 123,"username":"clx" },
type: "post",
dataType: "json",
success: function (data) {
alert(data)
}
});
});
});
</script>
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World");
string p= context.Request["PageIndex"].ToString();
context.Response.Write(p);
context.Response.End();
}
我alert DATA 出现NULL