title: OnClientClick not working
body: <p>I am having some problem with OnClientClick. </p>
  
  <p>I added a button into my webform like this.</p>
  
  <pre><code>&lt;asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
          style="top: 307px; left: 187px; position: absolute; height: 26px; width: 90px" 
          Text="Submit" OnClientClick="return validate()" /&gt;
  </code></pre>
  
  <p>And i am writing a javascript inside <code>&lt;head&gt;</code>immediately after the <code>&lt;title&gt;</code>.</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
      function validate() {
          if (document.getElementById("&lt;%=TextBox1%&gt;").value == "") {
          alert("textbox1 should not be empty");
          }
          else if(document.getElementById("&lt;%=TextBox2 %&gt;").value==""){
          alert("textbox2 should not be empty");
          }
                          }
  &lt;/script&gt;
  </code></pre>
  
  <p><code>TextBox1</code>and<code>TextBox2</code> are the Id's of two textboxes.</p>
  
  <p>But when i click on Submit button, OnClick is firing but OnClientClick is not firing.</p>
  
  <p>Whats the problem ?</p>
  
  <p>Please help.</p>