[prev in list] [next in list] [prev in thread] [next in thread]
List: mono-patches
Subject: [Mono-patches] xsp/test web_regularexpressionvalidator.aspx,1.1,1.2
From: gonzalo () mono-cvs ! ximian ! com (Gonzalo Paniagua)
Date: 2004-09-30 12:01:53
Message-ID: 20040930120153.CDC0B94763 () mono-cvs ! ximian ! com
[Download RAW message or body]
Update of /cvs/public/xsp/test
In directory mono-cvs.ximian.com:/tmp/cvs-serv31295/test
Modified Files:
web_regularexpressionvalidator.aspx
Log Message:
2004-09-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* test/web_regularexpressionvalidator.aspx: improved example. Patch by
Tomasz Rybak.
Index: web_regularexpressionvalidator.aspx
===================================================================
RCS file: /cvs/public/xsp/test/web_regularexpressionvalidator.aspx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- web_regularexpressionvalidator.aspx 14 Sep 2003 12:04:29 -0000 1.1
+++ web_regularexpressionvalidator.aspx 30 Sep 2004 12:01:51 -0000 1.2
@@ -11,9 +11,16 @@
</head>
<body>
+<p>RegularExpressionValidator returns true if input string is empty.
+So we added RequiredFieldValidator to make sure
+that all field are not empty and valid.
+</p>
<form runat="server">
<asp:Label text="Year (1900-2099, 2 or 4 digits):" runat="server"/><br>
<asp:TextBox id="year" runat="server" columns="4" maxLength="4"/><br>
+<asp:RequiredFieldValidator runat="server"
+ ControlToValidate="year"
+ ErrorMessage="empty!"/>
<asp:RegularExpressionValidator runat="server"
ControlToValidate="year"
ValidationExpression="(19|20)?\d{2}"
@@ -22,6 +29,9 @@
<asp:Label text="US Zip Code (xxxxx or xxxxx-xxxx):" runat="server"/><br>
<asp:TextBox id="zipcode" runat="server" columns="10" maxLength="10"/><br>
+<asp:RequiredFieldValidator runat="server"
+ ControlToValidate="zipcode"
+ ErrorMessage="empty!"/>
<asp:RegularExpressionValidator runat="server"
ControlToValidate="zipcode"
ValidationExpression="\d{5}(-\d{4})?"
@@ -30,6 +40,9 @@
<asp:Label text="Email address (e.g. someone@somewhere.com):" runat="server"/><br>
<asp:TextBox id="email" runat="server" columns="40"/><br>
+<asp:RequiredFieldValidator runat="server"
+ ControlToValidate="email"
+ ErrorMessage="empty!"/>
<asp:RegularExpressionValidator runat="server"
ControlToValidate="email"
ValidationExpression="[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*(\.[a-zA-Z]{2,3}){1,2}"
_______________________________________________
Mono-patches maillist - Mono-patches@ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic