You have to use client side JavaScript for this.........
<script language="javascript">
function KeyDownHandler(btn)
{
// process only the Enter key
if (event.keyCode == 13)
{
// cancel the default submit
event.returnValue=false;
event.cancel = true;
// submit the form by programmatically clicking the specified button
btn.click();
}
}
</script>
Code for a control that refers the JavaScript
<asp:textbox id="txtWhID" onkeydown="KeyDownHandlerton(btnSearch)" Enabled="true" Width="80px" Runat="server"
EnableViewState="false"></asp:textbox>
Button Control used to tie to the <enter> key
<asp:button id="btnSearch" Width="108px" Runat="server" Height="24px" BackColor="#E0E0E0" Text="Search >>"
Font-Size="Smaller" BorderColor="" ToolTip="Click to Get the Receipts Requiring Reconciliation" CausesValidation="False">
HTH
|