1)前台Default.aspx
$(function() {
var name = "zhcao";
var password = "870602";
$.ajax({
type: "Get", //访问WebService使用Get方式请求
url: "Ajax.aspx",
data: "name=" + name + "&password=" + password+"&action=test",
success: function(result) {//回调函数,result,返回值
alert(result);
}
});
});
2)后台(Ajax.aspx.cs)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace JqueryAjaxDemo
{
public partial class Ajax : System.Web.UI.Page
{