<script language="javascript" type="text/javascript">
function Perf()
{
if(window.event.keyCode==13)
{
var obj=document.activeElement
if(obj.id=="ctl00_mainContent_txtSearch")
{
<%=Page.GetPostBackEventReference(btnSearch,"")%>
}
}
}
document.οnkeydοwn=Perf
</script>
服务器段后台代码:
protected void btnSearch_Click(object sender, EventArgs e)
{
……相关查询代码……
}