-

- 加为好友
- 发送私信
- 在线聊天
-
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: <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: <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: <asp:TextBox id= "TextBox3 " runat= "server "> </asp:TextBox> <asp:RegularExpressionValidator id= "RegularExpressionValidator3 " runat= "server " ControlToValidate= "TextBox3 " ErrorMessage= "邮编格式不对 " ValidationExpression= "\d{6} "> </asp:RegularExpressionValidator> <br /> Address: <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: <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> <asp:Button id= "Button2 " runat= "server " Height= "27px " Text= "重置 " Width= "54px " CausesValidation= "False " UseSubmitBehavior= "False "> </asp:Button> </form> </body> </html> --------- 谢谢了,帮忙看下 我是新人啊 没分,对不起了 |
|
|
|
0
修改
删除
举报
引用
回复
| |