Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET validation summary inside formview doesn't work
    primarykey
    data
    text
    <p>I have a validation summary inside a asp.net formview and the validators just don't seem to trigger the validation summary.</p> <p>Things I already tried:</p> <ul> <li>Enable the ViewState on everything.</li> <li>Set the ClientID to static.</li> <li>Set the ValidationGroup to the same group on both all validators and the summary.</li> <li>Used Google to search for a solution.</li> </ul> <p>Anyone has any ideas on how to handle this? </p> <p>Code. Formview declaration:</p> <pre><code>&lt;asp:FormView ID="FormViewPerson" runat="server" DataSourceID="ObjectDataSourcePerson" DefaultMode="Edit" OnItemUpdating="FormViewPerson_ItemUpdating" OnItemCommand="FormViewPerson_ItemCommand" OnItemUpdated="FormViewPerson_ItemUpdated" Width="100%"&gt; </code></pre> <p>Any of the textboxes with the validator:</p> <pre><code>&lt;td&gt; &lt;asp:TextBox ID="NumberTextBox" runat="server" Text='&lt;%# Bind("Number") %&gt;' TabIndex="10" CausesValidation="True" ClientIDMode="Static" /&gt; &lt;asp:RequiredFieldValidator ID="RequiredFieldValidatorNumber" runat="server" ControlToValidate="NumberTextBox" ErrorMessage="Number is Required" ForeColor="Red" ValidationGroup="EditPerson"&gt;*&lt;/asp:RequiredFieldValidator&gt; &lt;/td&gt; </code></pre> <p>And the submitbutton:</p> <pre><code>&lt;asp:ValidationSummary ID="ValidationSummaryPerson" runat="server" ForeColor="Red" ClientIDMode="Static" CssClass="validation" ShowMessageBox="True" ValidationGroup="EditPerson" ViewStateMode="Enabled" /&gt; &lt;asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Save" ValidationGroup="EditPerson" CssClass="ButtonStyle" TabIndex="90" /&gt; &amp;nbsp;&lt;asp:Button ID="EditCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" CssClass="ButtonStyle" TabIndex="100" ValidationGroup="EditPerson" /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload