title: ASP Webforms Validation control not working
body: <p>Please help the regex Validator is not work when I click the button .</p>
  
  <pre><code>&lt;div class="panel-body"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;div class="input-group"&gt;
                          &lt;asp:Label runat="server" ID="lblAddBranch" Text="Branch Name" 
                             CssClass="text-primary small" AssociatedControlID="txtBranchName" /&gt;
                          &lt;asp:RegularExpressionValidator ID="RegExp1"
                            runat="server" ErrorMessage="Branch Name must be between 3 to 12 characters" 
                            ControlToValidate="txtBranchName" ValidationExpression="^[a-zA-Z]{3,12}$" ValidationGroup="grpBranch" /&gt;
                      &lt;/div&gt;
                      &lt;asp:TextBox runat="server" ID="txtBranchName" CssClass="form-control input-sm" ValidationGroup="grpBranch" /&gt;
                  &lt;/div&gt;
                  &lt;asp:Button runat="server" ID="btnAddBranch" Text="Add" CssClass="form-group-btn btn btn-sm btn-primary" 
                    OnClick="btnAddBranch_Click" ValidationGroup="grpBranch" /&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/GQ5S9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GQ5S9.png" alt="No Error Message"></a></p>