Query 传值的方式

 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");
           
        }

 

 

posted @ 2014-02-20 14:01  陌念  阅读(1450)  评论(0编辑  收藏  举报