博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
验证控件的使用八(分组验证)
阅读量:4994 次
发布时间:2019-06-12

本文共 2569 字,大约阅读时间需要 8 分钟。

 
1
<%
@ Page Language
=
"
C#
"
%>
2
3
<
html xmlns
=
"
http://www.w3.org/1999/xhtml
"
>
4
<
head id
=
"
Head1
"
runat
=
"
server
"
>
5
<
title
>
Validation Groups
</
title
>
6
</
head
>
7
<
body
>
8
<
form id
=
"
form1
"
runat
=
"
server
"
>
9
<
div
>
10
<
h1
>
St. Louis .NET User Group
</
h1
>
11
<
p
>
Username:
12
<
asp:TextBox ID
=
"
TextBox1
"
Runat
=
"
server
"
></
asp:TextBox
>&
nbsp; Password:
13
<
asp:TextBox ID
=
"
TextBox2
"
Runat
=
"
server
"
14
TextMode
=
"
Password
"
></
asp:TextBox
>&
nbsp;
15
<
asp:Button ID
=
"
Button1
"
Runat
=
"
server
"
Text
=
"
Login
"
16
ValidationGroup
=
"
Login
"
/>
17
<
br
/>
18
<
asp:RequiredFieldValidator ID
=
"
RequiredFieldValidator1
"
Runat
=
"
server
"
19
Text
=
"
* You must submit a username!
"
20
ControlToValidate
=
"
TextBox1
"
ValidationGroup
=
"
Login
"
>
21
</
asp:RequiredFieldValidator
>
22
<
br
/>
23
<
asp:RequiredFieldValidator ID
=
"
RequiredFieldValidator2
"
Runat
=
"
server
"
24
Text
=
"
* You must submit a password!
"
25
ControlToValidate
=
"
TextBox2
"
ValidationGroup
=
"
Login
"
>
26
</
asp:RequiredFieldValidator
>
27
<
p
>
28
Our main meeting
is
almost always held on the last Monday of the month.
29
Sometimes due to holidays or other extreme circumstances,
30
we move it to another night but that
is
very rare. Check the home page
31
of the web site
for
details. The special
32
interest groups meet at other times during the month. Check the SIG
33
page and visit their individual sites
for
more information.
34
You can also check our calendar page
for
a summary of events.
<
br
/>
35
</
p
>
36
<
h2
>
Sign
-
up
for
the newsletter
!</
h2
>
37
<
p
>
Email:
38
<
asp:TextBox ID
=
"
TextBox3
"
Runat
=
"
server
"
></
asp:TextBox
>&
nbsp;
39
<
asp:Button ID
=
"
Button2
"
Runat
=
"
server
"
Text
=
"
Sign-up
"
40
ValidationGroup
=
"
Newsletter
"
/>&
nbsp;
41
<
br
/>
42
<
asp:RegularExpressionValidator ID
=
"
RegularExpressionValidator1
"
43
Runat
=
"
server
"
44
Text
=
"
* You must submit a correctly formatted email address!
"
45
ControlToValidate
=
"
TextBox3
"
ValidationGroup
=
"
Newsletter
"
46
ValidationExpression
=
"
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
"
>
47
</
asp:RegularExpressionValidator
>
48
<
br
/>
49
<
asp:RequiredFieldValidator ID
=
"
RequiredFieldValidator3
"
Runat
=
"
server
"
50
Text
=
"
* You forgot your email address!
"
51
ControlToValidate
=
"
TextBox3
"
ValidationGroup
=
"
Newsletter
"
>
52
</
asp:RequiredFieldValidator
>
53
</
p
>
54
</
div
>
55
</
form
>
56
</
body
>
57
</
html
>

转载于:https://www.cnblogs.com/qiuweiguo/archive/2011/06/14/2080236.html

你可能感兴趣的文章
悬挂else引发的问题
查看>>
js题集29--部分题目在线答题链接地址
查看>>
PCLint 帮助中关于如何获得gcc/g++编译宏定义和头文件搜索目录的方法说明
查看>>
依赖注入模式
查看>>
Backbone.js之Todo源码浅析
查看>>
传统软件企业之殇
查看>>
[bzoj4491]我也不知道题目名字是什么
查看>>
CSS pusle雷达动画实现
查看>>
【问题解决方案】之 Word 公式编辑器 使用小tips
查看>>
模拟凡客导航
查看>>
BZOJ4804: 欧拉心算
查看>>
sublime text 3中安装ctags支持函数跳转,安装convertToUtf8支持中文步骤[工具篇]
查看>>
静态类和单例模式区别
查看>>
团队冲刺第一天
查看>>
二分查找法查找数组元素下表
查看>>
第四章 数据类型
查看>>
php-cgi.exe
查看>>
5.7 Windows常用网络命令
查看>>
防抖(Debouncing)和节流(Throttling)
查看>>
SQL Server 查询当前行、上一行、下一行合并查询
查看>>