title: Prevent page refresh in ASP.NET
body: <p>I have the following code in my aspx file:</p>
  
  <pre><code>&lt;button type="button" id="btnAskQuestion" runat="server" onserverclick="btnAskQuestion_Click"&gt;Ask Question&lt;/button&gt;
  </code></pre>
  
  <p>I've tried every combination of <code>onclick="return false;"</code> and <code>onclick="preventDefault()"</code> I can think of, including putting them in the javascript function that gets called. Everything I try has one of two results: either I get a postback, or the server side code (btnAskQuestion_Click) never executes.</p>
  
  <p>Any idea what I might be doing wrong?</p>