1 $.ajax({ 2 url: "TransBloodRequisition.aspx/aaa",//页面后台带方法名 3 contentType: "application/json",//必须为application/json 4 type: "POST",//必须为POST 5 data: "{ }",//格式为 "{a:1,b:2}" 6 dataType: "json",//必须为json 7 success: function (result) { 8 alert(result.d) 9 } 10 })
1 [WebMethod(EnableSession= true)] 2 public static string aaa() 3 { 4 return "bb" ; 5 }
原文:http://www.cnblogs.com/quexianwei/p/3929173.html