Login Control, Default Button, ugh.

Yes, you can definitely find this information elsewhere but...what happens when you want to use a login control on a page and also use the default button property so when a user hits enter it submits the login control's button.  Nothing, because you have no idea what the hell the ID of the submit button is. 

Here is the workaround:

<asp:LinkButton ID="lnkbtn1" runat="server" />
<asp:Panel ID="pnlLogin" runat="server" style="display:none" CssClass="modalPopup"  DefaultButton="Login1$LoginButton"  >
     <div class="modaltext">
    <label id="modalTextMessage" ></label>
    <asp:Login ID="Login1" runat="server" Width="246px" >
    </asp:Login>
    <asp:button id="btnCancel" runat="server" text="Cancel" />
    </div>
</asp:Panel>

Print | posted @ Friday, August 08, 2008 4:34 PM

Comments on this entry:

Gravatar # re: Login Control, Default Button, ugh.
by gagan at 8/18/2009 7:33 AM

Thank you... It worked,,,
Gravatar # re: Login Control, Default Button, ugh.
by Axel at 11/20/2009 2:47 AM

Very simple solution

Cheers,
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 
Twitter