zoukankan      html  css  js  c++  java
  • 在ASP.Net2.0中多个通过回车键提交表单时执行特定的button按钮事件

    <asp:Panel   id=Panel1   runat=server   DefaultButton="Button1">  
      <asp:TextBox   id=TextBox1   runat=server/>  
      <asp:Button   id=Button1   runat=server   Text="Button1"/>  
    </asp:Panel>  




    ============================附:另外一种作为的解决方法===================================


      写一个脚本,在文本框中加一个OnKeyDown的事件  
       
      <form   id="Form1"   method="post"   runat="server">  
       
      <asp:TextBox   id=TextBox1   runat="server"   OnKeyDown="SetFocus2()"></asp:TextBox>  
      <asp:TextBox   id=TextBox2   runat="server"   OnKeyDown="SetFocus2()"></asp:TextBox>  
      <asp:Button   id=Button1   runat="server"   Text="Button"></asp:Button>  
      <asp:ImageButton   id=ImageButton1   runat="server"   ImageUrl="idx_46_x.gif"></asp:ImageButton>  
      <asp:Label   id=Label1   runat="server">Label</asp:Label>  
       
      </form>  
       
      <script   language="javascript">  
      function   SetFocus2()  
      {  
      switch(window.event.keyCode)  
      {  
      case   13:  
      document.all.ImageButton1.focus();  
      }  
      }  
      </script>  
       
      判断是按Enten键(window.event.keyCode   为13)时执行
  • 相关阅读:
    Netty学习笔记(三) 自定义编码器
    JavaWeb 消息总线框架 Saka V0.0.1 发布
    BMP 图像信息隐藏及检测
    MATLAB之图像与音频信号处理
    MATLAB之基本语法与基础函数
    CVE-2018-14418 擦出新火花
    浅谈电子数字取证技术
    Linux 反弹 Shell
    Windows 反弹 Shell
    AWD攻防赛之各类漏洞FIX方案
  • 原文地址:https://www.cnblogs.com/zhangsir/p/947674.html
Copyright © 2011-2022 走看看