首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 培训 数据库 书店 程序员
中国软件网
欢迎您:游客 | 登录 注册 帮助
  • 求助验证控件的问题!救我 [已结贴,结贴人:goldenmice]
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • goldenmice
    • 等级:
    • 可用分等级:
    • 总技术专家分:
    • 总技术专家分排名:
    • 揭帖率:
    发表于:2007-04-28 21:51:12 楼主
    大虾们好
    我一个页面设置了两个Button控件
    其中一个是重置按钮,我把她的Causevalidation设为False
    但点了以后,Compare验证控件和RegularExpression被触发了一下
    然后又快速消失了
    怎么回事

    --------------
    源码
    <%@   Page   Language= "VB "   ValidateRequest= "false "%>
    <!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
    <html   xmlns= "http://www.w3.org/1999/xhtml ">
    <head   runat= "server ">
            <title> 无标题页 </title>
    <script   language= "vb "   runat= "server ">
    sub   SLC_Click(sender   as   object,e   as   eventargs)
    Textbox1.text= " "
    Textbox2.text= " "
    Textbox3.text= " "
    Textbox4.text= " "
    Textbox5.text= " "
    Textbox6.text= " "
    end   sub
    </script>
    </head>
    <body>
            <h3   align= "center "> 注册页面  
            </h3>
            <br   />
            <hr   />
            <form   id= "form1 "   runat= "server ">
                 
                            UserID:   &nbsp;   &nbsp;  
                            <asp:TextBox   id= "TextBox1 "   runat= "server "> </asp:TextBox>
                            <asp:RequiredFieldValidator   id= "RequiredFieldValidator2 "   runat= "server "   ControlToValidate= "TextBox1 "   ErrorMessage= "(*)请输入用户名   "> </asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator   id= "RegularExpressionValidator4 "   runat= "server "   ControlToValidate= "TextBox1 "   ErrorMessage= "用户名格式不对 "   ValidationExpression= "[A-Za-z]{1,}\d{0,} "> </asp:RegularExpressionValidator>
                            <br   />
                            Password:  
                            <asp:TextBox   id= "TextBox2 "   runat= "server "   TextMode= "Password "> </asp:TextBox>
                            <asp:RequiredFieldValidator   id= "RequiredFieldValidator1 "   runat= "server "   ControlToValidate= "TextBox2 "   ErrorMessage= "(*)请输入密码 "> </asp:RequiredFieldValidator> <br   />
                            Confirm   Password:&nbsp; <asp:TextBox   id= "TextBox6 "   runat= "server "   TextMode= "Password "> </asp:TextBox>
                            <asp:CompareValidator   id= "CompareValidator1 "   runat= "server "   ControlToValidate= "TextBox6 "   ErrorMessage= "两次输入的密码不一致 "   ControlToCompare= "TextBox2 "> </asp:CompareValidator>
                            <br   />
                            Zip:   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;  
                            <asp:TextBox   id= "TextBox3 "   runat= "server "> </asp:TextBox>
                            <asp:RegularExpressionValidator   id= "RegularExpressionValidator3 "   runat= "server "   ControlToValidate= "TextBox3 "   ErrorMessage= "邮编格式不对 "   ValidationExpression= "\d{6} "> </asp:RegularExpressionValidator>
                            <br   />
                            Address:   &nbsp;  
                            <asp:TextBox   id= "TextBox4 "   runat= "server "> </asp:TextBox>
                            <asp:RegularExpressionValidator   id= "RegularExpressionValidator1 "   runat= "server "   ControlToValidate= "TextBox4 "   ErrorMessage= "地址格式不对 "   ValidationExpression= ".{2,}省.{2,}市.{2,}区.{2,}[路,街]\d{1,}号 "> </asp:RegularExpressionValidator>
                            <br   />
                            E-Mail:   &nbsp;   &nbsp;  
                            <asp:TextBox   id= "TextBox5 "   runat= "server "> </asp:TextBox>
                            <asp:RegularExpressionValidator   id= "RegularExpressionValidator2 "   runat= "server "   ControlToValidate= "TextBox5 "   ErrorMessage= "E-mail格式不对 "   ValidationExpression= "\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* "> </asp:RegularExpressionValidator>
                            <br   />
                            <br   />
                            <hr   />
                            <br   />
                            <asp:Button   id= "Button1 "   runat= "server "   Height= "27px "   Text= "提交 "   Width= "54px "   UseSubmitBehavior= "False "   > </asp:Button>
                            &nbsp;  
                            <asp:Button   id= "Button2 "   runat= "server "   Height= "27px "   Text= "重置 "   Width= "54px "     CausesValidation= "False "   UseSubmitBehavior= "False "> </asp:Button>
            </form>
    </body>
    </html>
    ---------
    谢谢了,帮忙看下
    我是新人啊
    没分,对不起了
    0  修改 删除 举报 引用 回复

    网站简介广告服务网站地图帮助联系方式诚聘英才English 问题报告
    北京创新乐知广告有限公司 版权所有 京 ICP 证 070598 号
    世纪乐知(北京)网络技术有限公司 提供技术支持
    Copyright © 2000-2008, CSDN.NET, All Rights Reserved