我在這種情況下使用了多於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