Code
<div style="text-align: center">
整数:<asp:TextBox ID="txtNumeric" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="txtNumeric" Display="None" ErrorMessage="整数"
SetFocusOnError="True" ValidationExpression="((-)?[1-9]+\d*)|0"></asp:RegularExpressionValidator>
<br />
<br />
数字:<asp:TextBox ID="txtPNum" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server"
ControlToValidate="txtPNum" Display="None" ErrorMessage="数字"
SetFocusOnError="True"
ValidationExpression="(((-?[1-9]+\d*)|(-?0))\.\d+)|(((-)?[1-9]+\d*)|0)"></asp:RegularExpressionValidator>
<br />
<br />
字符/数字/下划线(至少6位):<asp:TextBox ID="txtCNL" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
ControlToValidate="txtCNL" Display="None" ErrorMessage="字符、数字、下划线至少6位"
SetFocusOnError="True" ValidationExpression="\w{6,}"></asp:RegularExpressionValidator>
<br />
<br />
邮箱:<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server"
ControlToValidate="txtEmail" Display="None" ErrorMessage="邮箱"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
<br />
<br />
网址:http(s)://<asp:TextBox ID="txtURL" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server"
ControlToValidate="txtURL" Display="None" ErrorMessage="网址"
ValidationExpression="([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"></asp:RegularExpressionValidator>
<br />
<br />
<br />
日期(8位数字):<asp:TextBox ID="txtDate" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server"
ControlToValidate="txtDate" Display="None" ErrorMessage="日期"
ValidationExpression="[1-9]\d{3}((0[1-9])|1[0-2])((0[1-9])|([1-2]\d)|(3[0-1]))"></asp:RegularExpressionValidator>
<br />
<br />
<asp:Button ID="Button2" runat="server" Text="Check" />
<br />
<br />
<div style="text-align: center">
<asp:ValidationSummary ID="ValidationSummary2" runat="server" />
</div>
<br />
</div>
<div style="text-align: center">
整数:<asp:TextBox ID="txtNumeric" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="txtNumeric" Display="None" ErrorMessage="整数"
SetFocusOnError="True" ValidationExpression="((-)?[1-9]+\d*)|0"></asp:RegularExpressionValidator>
<br />
<br />
数字:<asp:TextBox ID="txtPNum" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server"
ControlToValidate="txtPNum" Display="None" ErrorMessage="数字"
SetFocusOnError="True"
ValidationExpression="(((-?[1-9]+\d*)|(-?0))\.\d+)|(((-)?[1-9]+\d*)|0)"></asp:RegularExpressionValidator>
<br />
<br />
字符/数字/下划线(至少6位):<asp:TextBox ID="txtCNL" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
ControlToValidate="txtCNL" Display="None" ErrorMessage="字符、数字、下划线至少6位"
SetFocusOnError="True" ValidationExpression="\w{6,}"></asp:RegularExpressionValidator>
<br />
<br />
邮箱:<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server"
ControlToValidate="txtEmail" Display="None" ErrorMessage="邮箱"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
<br />
<br />
网址:http(s)://<asp:TextBox ID="txtURL" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server"
ControlToValidate="txtURL" Display="None" ErrorMessage="网址"
ValidationExpression="([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"></asp:RegularExpressionValidator>
<br />
<br />
<br />
日期(8位数字):<asp:TextBox ID="txtDate" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server"
ControlToValidate="txtDate" Display="None" ErrorMessage="日期"
ValidationExpression="[1-9]\d{3}((0[1-9])|1[0-2])((0[1-9])|([1-2]\d)|(3[0-1]))"></asp:RegularExpressionValidator>
<br />
<br />
<asp:Button ID="Button2" runat="server" Text="Check" />
<br />
<br />
<div style="text-align: center">
<asp:ValidationSummary ID="ValidationSummary2" runat="server" />
</div>
<br />
</div>