当前位置: 动力学知识库 > 问答 > 编程问答 >

asp.net - How to link a button to a textbox?

问题描述:

This question already has an answer here:

  • Perform Button click event when user press Enter key in Textbox

    6 answers

网友答案:

You can wrap the field and button in a Panel and use the DefaultButton property.

For example:

<asp:Panel ID="panel1" runat="server" DefaultButton="Btn1">
    <asp:TextBox ID="TxtPost" runat="server"></asp:TextBox>
    <asp:Button ID="Btn1" runat="server" />
</asp:Panel>
分享给朋友:
您可能感兴趣的文章:
随机阅读: