December 3, 2012

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" />

0推薦此文章
Today's Visitors: 0 Total Visitors: 3
Personal Category: Brian的程式筆記 Topic: learning / education / linguistic
[Trackback URL]

Post A Comment









Yes No



Please input the magic number:

( Prevent the annoy garbage messages )
( What if you cannot see the numbers? )
Please input the magic number

誰來收藏
Loading ...
unlog_NVPO 0