$.ajax({
url: 'xxxx.aspx/GetString', //方法一定是静态的
type: 'post',
dataType: "json",
contentType: "application/json; charset=utf-8",
data: '{"key":"' + value + '"}', //一定是json字符串
success: function (res) {
//res: {"d":"value"} ,返回一个key为 d 的json
}
})
[WebMethod]
public static string GetString(string key)
{
//do something...
return key;
}