CustomValidator message doesnt show up

asp.net, c#

Solution

I took the code exactly as in your question.

Changing `Display="None"` to `Display="Dynamic"` in the `asp:CustomValidator` causes the asterisk to appear.

Changing `ShowSummary="false"` to `ShowSummary="true"` in the `asp:ValidationSummary` causes the error message to appear in the summary.

Problem

I've a CustomValidator and I defined every possible parameter of it: ``` <asp:CustomValidator ID="custom" runat="server" Text="*" ErrorMessage="This email address is already registered" ControlToValidate="txtEmail" OnServerValidate="isExist" Display="None" ValidationGroup="valRegister"></asp:CustomValidator> ``` PS: I've a RequiredFieldValidator for same textbox and I dont want to check empty value. Here are other objects of the form: ``` <div class="row"><asp:Label runat="server" Text="Email" AssociatedControlID="txtEmail"></asp:Label><asp:RequiredFieldValidator runat="server" ErrorMessage="Please enter your email" Text="*" ControlToValidate="txtEmail"></asp:RequiredFieldValidator><asp:TextBox ID="txtEmail" runat="server" CssClass="inpBox"></asp:TextBox></div> <asp:Button runat="server" Text="Register" CssClass="btn" OnClick="register_member" CausesValidation="true" ValidationGroup="valRegister" /> <asp:ValidationSummary ID="validationSummary" runat="server" ShowMessageBox="true" ShowSummary="false" ValidationGroup="valRegister" /> ``` ``` protected void isExist(object sender, ServerValidateEventArgs args){ if (cre.member.isExist(args.Value)){ args.IsValid = false; } else { args.IsValid = true; } ``` } When I put an email already exist in the db table * appears on the form, but the error message doesnt show up. I tried all display options for custom error but no luck.

Original source

Related problems