[WebMethod]
public static string PageHelloWorld()
{
return "Hello,world";
}
2. 调用代码与webservice的非常类似///这个例子演示了如何调用页面的静态方法
function TestCallPageMethod() {
$.ajax({
type: "POST",
contentType: "application/json",
url: "mypage.aspx/PageHelloWorld",
data: "{}",
dataType: "json",
success: function(result) {
alert(result.d);
}
});
}