ASP.NET C# Textbox上按Enter 執行Button click event
<script type="text/javascript">
function EnterKey() {
if (event.keyCode == 13) {
document.getElementById("btnQuery").focus();
}
}
</script>
<asp:TextBox ID="txtYear" runat="server" onkeydown="EnterKey()"></asp:TextBox>
<asp:Button ID="btnQuery" runat="server" Text="查詢" onclick="btnQuery _Click" />
Today's Visitors: 0 Total Visitors: 3
Sealed (Aug 13)







