局部刷新數據,不通過后台刷新頁面獲取數據的方法


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

}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM