Thanks for your help, I still can't figure it out 
Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="Test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Employee Listing</title>
<script type="text/javascript">
function press(evt)
{
if(evt.which || evt.keyCode){
if ((evt.which == 13) || (evt.keyCode == 13)) {
//Use the id of the button you want as the default.
var buttonid = '<%=Button1.ClientID %>';
__doPostBack(buttonid,'');
returntrue;
}
} else { returnfalse; }
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="MyScriptManager" runat="server" />
<asp:updatepanel ID="MyUpdatePanel" runat="server">
<ContentTemplate>
<asp:Label ID="msg" runat="server" />
<asp:TextBox ID="txtName" runat="server" />
<asp:Button ID="btnFind" runat="server" Text="Find" onclick="btnFind_Click" />
</contentTemplate>
</form>
</body>
</html>
my code behind is Code:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
form1.attributes.add("onkeypress", "press(event);")
}
protected void btnFind_Click(object sender, EventArgs e)
{
msg.Text = "The Name to Search for is " + txtName.Text;
}
Bookmarks