Form Post by Enter Button



I have the following simple code of two panels and two pairs of
textboxes and buttons.

<form id="Form1" method="post" runat="server">

<asp:panel id="Panel1" runat="server" Width="272px" Height="96px">
<asp:TextBox id="Textbox1" runat="server"></asp:TextBox>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>


<asp:panel id="Panel2" runat="server" Width="288px" Height="80px">
<asp:TextBox id="TextBox2" runat="server"></asp:TextBox>
<asp:Button id="Button2" runat="server" Text="Button"></asp:Button>


What I would like to accomplish is...If i enter some text in Textbox1
and press "ENTER" button, the event associated with Button1 should
trigger. Likewise for Pair2.

How can one get to this with only one server form tag per page.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question