.Net結合JQuery實現向aspx後臺函數進行請求。
阿新 • • 發佈:2018-09-27
clas services ice ati app system 進行 efault async
https://www.cnblogs.com/linji/archive/2012/03/22/2411058.html
$.ajax({
url:
"Default.aspx/aaaa"
,
async:
false
,
type:
"POST"
,
contentType:
"application/json; charset=utf-8"
,
dataType:
"json"
,
data: {name:
"Tom"
,content:
"hello"
},
success:
function
(data) {
alert(data.d);
},
error:
function
() {
alert(
"error!"
);
}
});
using
System.Web.Services;
using
System.Web.Script.Services;
[WebMethod]
public
static
string
aaaa(
string
name,
string
content)
{
return
name +
":"
+ content;
}
https://www.cnblogs.com/linji/archive/2012/03/22/2411058.html
.Net結合JQuery實現向aspx後臺函數進行請求。