title: How can I trigger Button's OnClick event from Javascript in an asp.net application which is using Callback?
body: <p>I'm using Callback, on a asp.net webforms project. When clicked button, it is working great. However I have a textbox, when user press 'enter' it must trigger button. So I did it,</p>
  
  <pre><code>function search_enter(event) {
      if (event.keyCode == 13) {
          $("#search_button").click();
      }
  }
  </code></pre>
  
  <p>Yes, it triggers first javascript function of callbacks. But it is doing postback not callback :S</p>
  
  <p>How can I fix this?</p>
  
  <p><strong>Update:</strong>
  I solve the problem, calling callback event at input's keyup event.</p>
  
  <pre><code>function search_enter(event) {
          if ($('#search_textbox').val() == '')
              return;
          WebForm_DoCallback('__Page', Basla(), Istek, null, Hata, true)
      }
  &lt;input id="search_textbox" onkeyup="search_enter(event)" type="text"  /&gt;
  </code></pre>
  
  <p>But if I pressed enter, when cursor in input. It is doing postback. How can I fix this?</p>