﻿// JScript 文件
        function checkCode(args)//textBox的onkeyup事件的验证
            {
               var tool = $("#codeTool");  
               var code=args.value;
               if(code.length == 4)
               {
                    $.ajax({
                       type: "GET",
                       url: "CallBack/getAutoCode.ashx?checkCode="+code+"&times="+new Date(),
                       success: function(re){
                            if(re=="true")
                            {
                                tool.html(" <font color='green'>验证码正确</font>");
                            }
                            else
                            {
                                tool.html(" <font color='red'>验证码错误！</font>");
                                ReBtn();//重新刷新验证码
                                //window.location.reload();
                            }
                       }
                    });
                }
                else
                {
                    tool.html(" <font color='red'>验证码是4位不区分大小写的字母！</font>");
                }
            }
            
        function reCheckCode(source,args)//验证控件的验证            {
               var tool = $("#codeTool");  
               var code=args.Value;
               if(code.length == 4)
               {
                    $.ajax({
                       type: "GET",
                       url: "CallBack/getAutoCode.ashx?checkCode="+code+"&times="+new Date(),
                       success: function(re){
                            if(re=="true")
                            {
                                args.IsValid = true;
                            }
                            else
                            {
                                args.IsValid = false;
                                tool.html(" <font color='red'>验证码错误！</font>");
                                ReBtn();//重新刷新验证码
                            }
                       }
                    });
                }
                else
                {
                    args.IsValid = false;
                    tool.html(" <font color='red'>验证码错误！</font>");
                }
            }

