ajax访问 aspx.cs后台

--前台
$.ajax({ 
type: "POST", 
contentType: "application/json", 
url: "WebForm2.aspx/GetUserName", 
data: "{}", 
dataType: "json", 
success: function(){.......} 
});

--list集合

$.ajax({
type: "POST",
contentType: "application/json",
url: "DeHx.aspx/GetUserName",
data: "", // data:"{uid:"+str+"}",
dataType: "json",
success: function(data){
$.each(data, function (key, val) {
var te = eval(data[key]);
alert(te);
});
}
});

--后台

[WebMethod(EnableSession = true)]
public static string GetUserName()  //(string  uid)
{
return "123";
}

上一篇:ubuntu中python3安装package


下一篇:UVA 568 Just the Facts (水)