我要檢查客戶端寫整型在我的文本框,所以我寫我這樣的代碼:文本框整數驗證錯誤
<td class="style2">
<asp:TextBox ID="phonetxt" runat="server" Height="22px" MaxLength="10"
Width="158px"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="PhoneRequiredFieldValidator" runat="server" ForeColor="Red" ControlToValidate="phonetxt" ErrorMessage="...."></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" Display="None" ErrorMessage="Accepts only numbers." ControlToValidate="phonetxt" ValidationExpression=""^[0-9]*$" Text="*"></asp:RegularExpressionValidator>
</td>
但有錯誤發生這樣的:
Server Error in '/' Application.
Parser ErrorDescription: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The server tag is not well formed.
Source Error: Line 153: Line 154: Line 155: Line 156: Line 157:Source File: /account.aspx Line: 155
什麼shold我現在做?有沒有更好的方法來檢查?
感謝它現在的工作,但它沒有顯示任何錯誤,當我寫錯誤的值!!!!有什麼問題? –
一個'''需要在文本內轉義 - 所以你需要寫''''' – fubo