日期:2014-05-16 浏览次数:20886 次
$.ajax({
type: "Post",
// url: "WebForm1.aspx/SayHello",
url: "WebForm1.aspx",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: "{'str':'我是','str2':'XXX'}",
success: function (data) {
//返回的数据用data.d获取内容
alert(data.d);
},
error: function (err) {
alert(err);
}
});
protected void Page_Load(object sender, EventArgs e)
{
string a = Context.Request["str"];
string b = Request["str"];
string c = Request.Form["str"];
string d = Request.QueryString["str"];
}
//data: "{'str':'我是','str2':'XXX'}",
//==>
data: {'str':'我是','str2':'XXX'},
$.ajax({