Your browser will automatically submit the form when you press the enter button. To undo this, add return false to the updateSearchTextBox function.
if this does not work, try the following:
<script language="JavaScript"> function disableEnterKey(e) { var key; if(window.event) key = window.event.keyCode; </script>
And in your code:
textbox.Attributes.Add("OnKeyPress","return disableEnterKey(event)");
Flyswat
source share