前台JQ代码:
$.ajax({
type: "post",
url: "Default.aspx/PipeData",
contentType: "application/json;charset=utf-8",
dataType: "json",
success: function (res) {
alert(res.d)
},
error: function (xmlReq, err, c) {
alert("error!!");
}
});
后台代码:
public static string PipeData()
{
string myjson = "hello";
return myjson;
}