title: validator shows, but button executes server code
body: <p>Something seems to be broken...I have a asp textbox in my Web Forms application, that has a Required Field Validator. If the textbox is empty, it shows the validator but also executes the server code, in that case code for insert into a table:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
              &lt;asp:Label ID="lblPName" runat="server" CssClass="col-md-2 control-label" Text="Category Name"&gt;&lt;/asp:Label&gt;
              &lt;div class="col-md-3"&gt;
                  &lt;asp:TextBox ID="txtCategoryName" runat="server" CssClass="form-control"&gt;&lt;/asp:TextBox&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" CssClass="text-danger" runat="server" ErrorMessage="This Field is required" ControlToValidate="txtCategoryName"&gt;&lt;/asp:RequiredFieldValidator&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>Button code:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
              &lt;div class="col-md-2"&gt;&lt;/div&gt;
              &lt;div class="col-md-6"&gt;
                  &lt;asp:Button ID="btnAddCategory" CssClass="btn btn-default" runat="server" Text="Add" onclick="btnAddCategory_Click" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>And my server side code for inserting data:</p>
  
  <pre><code>string cs = ConfigurationManager.ConnectionStrings["MyDatabaseConnectionString"].ConnectionString;
          using (SqlConnection con = new SqlConnection(cs))
          {
              SqlCommand cmd = new SqlCommand("Insert into tblCategories values(@CategoryName)", con);
              cmd.Parameters.AddWithValue("@CategoryName", txtCategoryName.Text);
              con.Open();
              cmd.ExecuteNonQuery();
              txtCategoryName.Text = string.Empty;
          }
          BindCategoryRepeater();
  </code></pre>
  
  <p>Any reason why something like that would happen?</p>