局部刷新数据,不通过后台刷新页面获取数据的方法

function OnSend() {
            var userName = document.getElementById("userName").value;
            var phone = document.getElementById("phone").value;
            var radio = document.getElementsByName("type");
            if (radio[0].checked) {
                var data = "type=0&valiType=0&userName=" + userName + "&phone=" + phone; //参数
                jsHelper.doGet("/ASHX/Security.ashx", data, true, function (obj) {
                    var dataText = obj.responseText; //
                    if (dataText == "True") {
                        settime();
                    }
                    else {
                        document.getElementById("errShow").innerHTML = "用户名或手机号错误,请重新输入!";
                    }
                }, "json");
            }
            else {
                var data = "type=0&valiType=1&userName=" + userName + "&phone=" + phone; //参数
                jsHelper.doGet("/ASHX/Security.ashx", data, true, function (obj) {
                    var dataText = obj.responseText; //
                    if (dataText == "True") {
                        settime();
                    }
                    else {
                        document.getElementById("errShow").innerHTML = "用户名或邮箱错误,请重新输入!";
                    }
                }, "json");
            }
        }

 

 

public void ProcessRequest(HttpContext context)
        {
            string type = context.Request.Params["type"];
            switch (type)
            {
                case "0":
                    ValidateResetPwd(context); //重置密码条件验证
                    break;
                default:
                    break;
            }
        }

 

 

private void ValidateResetPwd(HttpContext context)        

{            

    int valiType = Convert.ToInt16(context.Request.Params["valiType"]);            

    string userName = context.Request.Params["userName"];            

    string phone = context.Request.Params["phone"];

            //生成新编码            

    bool retValue = BLL.UserInfo.ValidateResetPwd(valiType, phone, userName);

            context.Response.Write(retValue);        

}

转载于:https://www.cnblogs.com/dzhjhp/p/4717006.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值