Here's a neat trick:
<asp:Panel ID="pnlLogon" runat="server" DefaultButton="lbLogin" Width="100%" > <asp:TextBox id="tbUserName" runat="server" size="10" /> <asp:TextBox id="tbPassword" runat="server" TextMode="Password" size="10" /> <asp:LinkButton Text="login" CssClass="submit" runat="server" ID="lbLogin" OnClick="btnLogin_OnClick" /> </asp:Panel>
By wrapping the text fields in the panel and setting the DefaultButton panel to your LinkButton , any input in the text field inside the panel will call LinkButton Click to occur.
source share