Form Post by Enter Button

  • Thread starter Thread starter Raghuvansh
  • Start date Start date
R

Raghuvansh

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>

<br><br>

<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>
</asp:Panel>

</form>


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.
 
Back
Top