title: Having to click button twice to trigger postback in asp.net
body: <p>I have some validation code in my searchbutton click event and have been having problems with it having to be clicked twice to work. 
  Asp Code: </p>
  
  <pre><code>        &lt;asp:Button ID="SearchButton" runat="server" Text="Search" Width="148px" OnClick="SearchButton_Click"  style="height: 35px" /&gt;
  </code></pre>
  
  <p>Code Behind</p>
  
  <pre><code>protected void SearchButton_Click(object sender, EventArgs e)
  {
          string title = TitleSearch.Text;
          Regex rgx = new Regex("^[0-9A-Za-z ]+$");
          if (title != "" &amp;&amp; !rgx.IsMatch(title))
          {
              ErrorLabel.Text = "Special characters are not allowed";
          }
          else
          {
               SearchButton.PostBackUrl = "results.aspx";
  
          }
  }
  </code></pre>