title: Elegant way to make CustomValidator work with ValidationSummary messagebox
body: <p>I have run into this problem before but never quite solved it. I have a form with several validators and also a CustomValidator.</p>
  
  <pre><code>&lt;asp:Label ID="lblMemberNum" runat="server" Text="Membership #:" CssClass="LabelMedium"  &gt;&lt;/asp:Label&gt;
  &lt;asp:TextBox ID="txtMemberNum" runat="server" CssClass="TextBox" &gt;&lt;/asp:TextBox&gt;
  &lt;asp:RequiredFieldValidator ID="rfvMemberNum" SetFocusOnError="True" runat="server"
      ControlToValidate="txtMemberNum" ErrorMessage="[ Membership # ] is required"
      CssClass="ValidationMessage" Display="Dynamic" &gt;*&lt;/asp:RequiredFieldValidator&gt;
  &lt;asp:RegularExpressionValidator ID="revMemberNum"  Display="Dynamic" runat="server" 
      ControlToValidate="txtMemberNum" CssClass="ValidationMessage" 
      ErrorMessage="[ Membership # ] can only contain letters" 
      ValidationExpression="^([a-zA-Z\d]+)$" &gt;*&lt;/asp:RegularExpressionValidator&gt;
  &lt;asp:CustomValidator ID="cvMemberNum" runat="server" 
      CssClass="ValidationMessage" Display="Dynamic"
      ControlToValidate="txtMemberNum" ValidateEmptyText="false"
      OnServerValidate="cvMemberNum_Validate" 
      ErrorMessage="This membership number is already registered"&gt;*&lt;/asp:CustomValidator&gt;
  
  &lt;asp:ValidationSummary ID="ValidationSummary1" runat="server" 
      CssClass="ValidationMessage" 
      ShowMessageBox="True" ShowSummary="False" /&gt;
  </code></pre>
  
  <p>and on the server side:</p>
  
  <pre><code>protected void cvMemberNum_Validate(object source, ServerValidateEventArgs args)
  {
      try
      {
          args.IsValid  = (!CampaignRegistration.IsMemberRegistered(args.Value));
      }
      catch
      {
          args.IsValid = false;
      }
  }
  </code></pre>
  
  <p>My problem is: The ValidationSummary never shows the message from CustomValidator. This question has been asked in several places, but I havent seen a satisfactory answer.</p>