Asp.net buttonclick server event firing when textbox is entered
<p>I have a textbox and a button.</p>

<p>The button has a <code>btn_click(obj, eventargs)</code> on codebehind.</p>

<p>This is on <code>master</code> page.</p>

<p>What I want is when the textbox is focused and click <code>enter</code>,</p>

<p>I want to run that function, in other words, click the button.</p>

<p>So, I wrote...</p>

<pre><code>$("#" + "&lt;%= txtSearch.ClientID %&gt;").keypress(function (e) {
  var code = (e.keyCode ? e.keyCode : e.which);
  if (code == 13) {
    $("#" + "&lt;%= imgBtnSearch.ClientID %&gt;").click();
}
</code></pre>

<p>On server side function, I am redirecting to another page.</p>

<p>Since it is not redirecting, can i assume that it is not working?</p>

<p>Is there anything I can make it work?</p>

<p>});</p>
