<p>I have a <code>textbox</code> whose input is being handled by jQuery.</p>

<pre><code>$('input.Search').bind("keyup", updateSearchTextbox);
</code></pre>

<p>When I press <code>Enter</code> in the textbox, I get a postback, which messes everything up. How can I trap that Enter and ignore it?</p>

<p>(Just to preempt one possible suggestion: The textbox has to be an <code>&lt;asp:textbox ... /&gt;</code> - I can't replace it with an <code>&lt;input ... /&gt;</code>.)</p>

Your browser is automatically submitting the form when you press enter. To cancel this, add return false to your updateSearchTextBox function.
if that doesn't work, try this:
```
```
<script language="JavaScript">

function disableEnterKey(e)
{
     var key;     
     if(window.event)
          key = window.event.keyCode; //IE
     else
          key = e.which; //firefox     

     return (key != 13);
}

</script>
```
```
And in your codebehind:
```
```
textbox.Attributes.Add("OnKeyPress","return disableEnterKey(event)");
```
```