title: How to call postback using javascript on ASP.NET form
body: <p>I have a web form with textbox and button. I want after "ENTER" key click on textbox postbak form.</p>
  
  <p>I am using next code:</p>
  
  <pre><code>onkeypress=" if(event.keyCode==13)
   { alert(2);
  WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$ContentPlaceHolder1$btnSearch', '', true, '', '', false, false));
  alert(2); 
  return false;}
  </code></pre>
  
  <p>where <code>WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$ContentPlaceHolder1$btnSearch', '', true, '', '', false, false));</code></p>
  
  <p>is javascript code for button event onclick.</p>
  
  <p>I get two alerts, but postback doesnot happen.</p>
  
  <p>Any ideas what is wrong?</p>