1
$.get("/admin/ashx/wallet.ashx", { "username": username, "t": Math.random() }, function (obj) {},"json")
2
$.post("/admin/ashx/wallet.ashx", data + "&type=m", function (obj) {},"json")
3 传到本页面的
$.post("/Login/login2.aspx", { "username": txtuser, "userpwd":txtpwd ,"code":code},
function () {
},"json")
在后台
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Headers["X-Requested-With"] != null
&& Request.Headers["X-Requested-With"].ToLower() == "XMLHttpRequest".ToLower())
{
if (!string.IsNullOrEmpty(Request.Params["username"])
&& !string.IsNullOrEmpty(Request.Params["userpwd"])
&& !string.IsNullOrEmpty(Request.Params["code"]))
{
Login();
}
}
}
void Login()
{
Response.Write("1");
}