如何在TextBox中使用回车键快速提交请求呢?今天在项目中就遇到了这样的需求,一下是我的解决方案。 页面效果: ASPX页面: Search: <asp:TextBox ID="txtKeyWord" runat="server" onkeypress="javascript:doSearch(event)"></asp:TextBox> <asp:DropDownList ID="ddlOption" runat="server"> <asp:ListItem>Name</asp:ListItem> <asp:ListItem>Surname</asp:ListItem> </asp:DropDownList> <asp:Button ID="btnSearch" runat="server" Text="OK" Width="42px" OnClick="btnSearch_Click" /> JS代码: <script>function doSearch(e)> CS文件: 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