我正在使用 ASP.NET 1.1,我的验证摘要和验证控件工作时遇到问题。单击按钮时,不会触发必填字段验证等。我该如何解决?
这是代码:
<asp:ValidationSummary id="EsppDataInputValidationSummary" runat="server" Font-Names="Arial" Font-Size="8pt" HeaderText="Please Correct the following error(s):" DisplayMode="List" ShowSummary="True"></asp:ValidationSummary></TD>
<asp:RequiredFieldValidator id="Validator1" runat="server" Font-Size="8pt" Font-Names="Arial"
ControlToValidate="txtPrice" Display="None" ErrorMessage="Please enter the Price"></asp:RequiredFieldValidator>
<asp:textbox onblur="return ValidateLength(this)" style="Z-INDEX: 0; TEXT-ALIGN: right" id="txtPurchasePrice" onkeypress="return IsValidChar(event);" onkeyup="return ValidateLength(this)" runat="server" Width="160px" MaxLength="10"></asp:textbox>
<asp:button id="btnAdd" runat="server" Text="Add"></asp:button>"