我在表格表中有一个验证摘要,而有效的人似乎并没有触发验证摘要。
我已尝试过:
- Enable the ViewState on everything.
- Set the ClientID to static.
- Set the ValidationGroup to the same group on both all validators and the summary.
- Used Google to search for a solution.
没有人对如何处理这一问题有任何想法?
法典:概览声明
<asp:FormView ID="FormViewPerson" runat="server" DataSourceID="ObjectDataSourcePerson"
DefaultMode="Edit" OnItemUpdating="FormViewPerson_ItemUpdating" OnItemCommand="FormViewPerson_ItemCommand"
OnItemUpdated="FormViewPerson_ItemUpdated" Width="100%">
与有效方的任何文本箱:
<td> <asp:TextBox ID="NumberTextBox" runat="server" Text= <%# Bind("Number") %>
TabIndex="10" CausesValidation="True" ClientIDMode="Static" />
<asp:RequiredFieldValidator ID="RequiredFieldValidatorNumber" runat="server" ControlToValidate="NumberTextBox"
ErrorMessage="Number is Required" ForeColor="Red"
ValidationGroup="EditPerson">*</asp:RequiredFieldValidator>
</td>
提交:
<asp:ValidationSummary ID="ValidationSummaryPerson" runat="server"
ForeColor="Red" ClientIDMode="Static" CssClass="validation"
ShowMessageBox="True" ValidationGroup="EditPerson" ViewStateMode="Enabled"
/>
<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
Text="Save" ValidationGroup="EditPerson" CssClass="ButtonStyle" TabIndex="90" />
<asp:Button ID="EditCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
Text="Cancel" CssClass="ButtonStyle" TabIndex="100"
ValidationGroup="EditPerson" />