How to prevent page refresh when using jQuery in asp.net
<p>I am trying to implement some jQuery into my asp project and every time a function is triggered is causes the page to refresh back to its initial state. I can see the results triggered by the jQuery for a split second then the page is refreshing so I know that the jQuery is fine.</p>

<p>Is there a way in which this can be stopped. I have tried searching around but there is noting that really explains how to do this and I am realitvly new to the world of asp .net.</p>

<p>I was thinking that I somehow need to use .preventDefault() but have not managed to string anything together.</p>

<p>Hers my code is basically puts the value of option into textbox and shows textbox when select is clicked</p>

<pre><code> &lt;select id="ops"&gt;
   &lt;option&gt;Choose Property&lt;/option&gt;
   &lt;option value="one"&gt;one&lt;/option&gt;
   &lt;option value="two"&gt;two&lt;/option&gt; 
  &lt;/select&gt;
 &lt;asp:Button ClientIDMode="Static" ID="select" runat="server" Text="Select"/&gt;

&lt;div id="mydiv"&gt;
&lt;asp:TextBox ClientIDMode="Static" Enabled="false" ID="textbox" runat="server" CssClass="textEntry" /&gt;
&lt;/div&gt;



&lt;script type="text/javascript"&gt;
       $(document).ready(function () {
           $('#mydiv').hide();
           $('#ops').click(getOps);
       });

       function getOps() {
           var choice = $(this).val();
           $('#select').click(function () {
               $('#mydiv').show();
               $('#textbox').val(choice);
           });
       }

&lt;/script&gt;
</code></pre>
