我是 asp.net 的新手,遇到了一些小问题,问题是为单个设置多个验证器Textbox
。我设置了验证,但是在运行它时,验证是逐步进行的,而不是在一个地方。
这是我的代码:
<td align="right" style="padding-right: 5px; width: 50%;">
<asp:Label ID="lblConformPassword" runat="server" Text="CONFORMPASSWORD :"></asp:Label>
</td>
<td align="left" style="padding-left: 5px; width: 50%; color: #FF0000;">
<br />
<br />
<br />
<asp:TextBox ID="txtConformPassword" runat="server" TextMode="Password" Width="70%"
ForeColor="red" AutoCompleteType="Office"></asp:TextBox>
* <br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtConformPassword"
ErrorMessage="You can't leave this empty." Style="color: #FF0000;"></asp:RequiredFieldValidator>
<br />
<asp:RegularExpressionValidator ID="rfvConformPassword" runat="server" ControlToValidate="txtConformPassword"
ErrorMessage="SEE THE NOTE" ValidationExpression="(?=^.{6,}$)(?=.*\d)(?=.*\W+)(?![.\n]).*$"></asp:RegularExpressionValidator>
<br />
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txtpassword"
ControlToValidate="txtconformpassword" ErrorMessage="Password And ConformPassword Should Be Same."
Display="Dynamic" Style="color: #FF0000; margin-left: 0px"></asp:CompareValidator>
<br />
</td>
所有验证都应在单行中进行。我该怎么设置呢?任何人都可以帮助我完成这个过程吗?