我在这种情况下使用了多于1个文本框验证如果第一次验证未通过,则第二次验证在第一次验证程序出现一些空白后显示。在我的项目中,电子邮件的文本框我使用两个验证requiredfield和正则表达式,但我的正则表达式验证器没有显示在正确的地方。我试过css即左边距,但不适用于我。 我的代码是 名 姓 电子邮件ID 验证控制中的格式问题
</td>
</tr>
<tr>
<td>
User Id
</td>
<td>
<asp:TextBox ID="TextBox7" runat="server" EnableViewState="true" Height="22px" Width="189px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
ControlToValidate="TextBox7"
ErrorMessage="It is a mandatory field Can't be left blank" ForeColor="#FF3300"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Password
</td>
<td>
<asp:TextBox ID="TextBox4" runat="server" EnableViewState="true" TextMode="Password" Height="22px" Width="189px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
ForeColor="#FF3300" ControlToValidate="TextBox4" ErrorMessage="It is a mandatory field Can't be left blank"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Full Address
</td>
<td>
<asp:TextBox ID="TextBox5" runat="server" Height="64px" TextMode="MultiLine" Width="189px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
ForeColor="#FF3300" ControlToValidate="TextBox5" ErrorMessage="It is a mandatory field Can't be left blank"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Mobile No.
</td>
<td>
<asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server"
ForeColor="#FF3300" ControlToValidate="TextBox4" ErrorMessage="It is a mandatory field Can't be left blank"></asp:RequiredFieldValidator>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ForeColor="#FF3300" ControlToValidate="TextBox6" ErrorMessage="Not in the correct format"
MaximumValue="9999999999" MinimumValue="1000000000"></asp:RangeValidator>
</td>
</tr>
</table>
<asp:ImageButton ID="ImageButton1" runat="server"
ImageUrl="~/img/str/buttons/submit_blue.png" onclick="ImageButton1_Click" />
Thankyou这么多,对我来说工作正常 –
好的答案! – retrodrone