zoukankan      html  css  js  c++  java
  • Asp.net 回车默认按钮

    <head>

    <script type="text/javascript">

          function OnKey()
          {
              if (event.keyCode == 13)
              {
                  document.getElementById('<%=btnLogin.ClientID%>').focus();
                  document.getElementById('<%=btnLogin.ClientID%>').click();
              }
          }

          document.onkeydown = OnKey;
    </script>

    </head>

    我目前认为一般的块标签 好像都有 DefaultButton  这个默认的熟悉

    <body>    

    <form id="form1" runat="server" DefaultButton="btnLogin">

       <asp:Panel ID="Panel2" runat="server" DefaultButton="btnLogin">
                            <table  border="0px" cellpadding="0px" cellspacing="0px" style="border: 0px;">
                                <tr>
                                    <td>
                                        User Name<b>:</b>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:TextBox ID="txtName" runat="server" CssClass="txtbox" BorderStyle="Inset"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="height: 30px;">
                                        Pin<b>:</b>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:TextBox ID="txtPwd" runat="server" CssClass="txtbox" BorderStyle="Inset" TextMode="Password"></asp:TextBox><br>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <br>
                                        <asp:Button ID="btnLogin" CssClass="btn" runat="server" Text="Login" OnClick="btnLogin_Click"
                                            UseSubmitBehavior="False" />
                                        &nbsp;&nbsp;
                                        <asp:Button ID="btnLogout" CssClass="btn" runat="server" Text="Logout" OnClick="btnLogout_Click"
                                            UseSubmitBehavior="False" />
                                    </td>
                                </tr>
                            </table>

    </body>

  • 相关阅读:
    Qt QMutex使用详解
    libpng warning: iCCP: cHRM chunk does not match sRGB
    Qt tr()的作用
    Qt 关于QT_BEGIN_NAMESPACE宏的作用
    Qt 串口收发数据
    Qt QSerialPort串口通讯的时候,readyRead()信号不产生的解决方案
    Qt QSerialPort串口 接收数据 QIODevice::readyRead()
    Qt QString与QByteArray互相转换的方法
    Qt QString字符串分割、截取
    Qt 从QString中提取出数字
  • 原文地址:https://www.cnblogs.com/ChinaZhao/p/5801905.html
Copyright © 2011-2022 走看看