如何在TextBox中使用回车键快速提交请求呢?今天在项目中就遇到了这样的需求,一下是我的解决方案。

  页面效果:
Web表单中,如何使用回车键在TextBox中提交请求

  ASPX页面:
Web表单中,如何使用回车键在TextBox中提交请求            Search:
Web表单中,如何使用回车键在TextBox中提交请求            
<asp:TextBox ID="txtKeyWord" runat="server" onkeypress="javascript:doSearch(event)"></asp:TextBox>&nbsp; &nbsp;<asp:DropDownList
Web表单中,如何使用回车键在TextBox中提交请求                
ID="ddlOption" runat="server">
Web表单中,如何使用回车键在TextBox中提交请求                
<asp:ListItem>Name</asp:ListItem>
Web表单中,如何使用回车键在TextBox中提交请求                
<asp:ListItem>Surname</asp:ListItem>
Web表单中,如何使用回车键在TextBox中提交请求            
</asp:DropDownList>
Web表单中,如何使用回车键在TextBox中提交请求            
&nbsp;
Web表单中,如何使用回车键在TextBox中提交请求            
<asp:Button ID="btnSearch" runat="server" Text="OK" Width="42px" OnClick="btnSearch_Click" />

  JS代码:
Web表单中,如何使用回车键在TextBox中提交请求<script>
Web表单中,如何使用回车键在TextBox中提交请求
function doSearch(e)
>


  CS文件:
Web表单中,如何使用回车键在TextBox中提交请求    protected void Page_Load(object sender, EventArgs e)
    }

相关文章:

  • 2021-08-31
  • 2021-06-14
  • 2021-11-07
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-17
  • 2021-11-26
  • 2022-12-23
  • 2021-10-07
相关资源
相似解决方案