这是我的AJAX代码的一部分:
$.ajax({
type: "POST",
url: "ajax.ashx?method=LoadCities",
data: "{state_id:'" + state_id + "'}",
contentType: "application/json;charset=utf-8",
dataType: "json",
.
.
.
这是我的ASHX处理程序代码的一部分:
public class ajax : IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "application/json;charset=utf-8";
string method = context.Request["method"];
if (method == "LoadCities")
{
object ss = context.Request.Form["state_id"];
context.Response.Write(LoadCities(ss));
}
}
我无法获取 "state_id",它总是为 null
。如何才能获得 "state_id" 呢?