Results 1 to 2 of 2

Thread: [2008] LinkButton - Submit on Enter

  1. #1

    Thread Starter
    Hyperactive Member Ms.Longstocking's Avatar
    Join Date
    Oct 2006
    Posts
    399

    [2008] LinkButton - Submit on Enter

    I would like for my LinkButton to submit my login request upon hitting Enter.

    This is my LinkButton(note: resides in a LoginView[Anonymous] template):

    Code:
    <asp:Panel ID="Panel1" runat="server" DefaultButton="loginButton">
    <asp:LinkButton  ID="loginButton" CssClass="btnLogin" CommandName="Login" 
    CausesValidation="true" ValidationGroup="Login1" runat="server" UseSubmitBehavior="false" Text="Sign In" />
    </asp:Panel>
    IE is ok.
    Firefox bad.

    I've come across some fixes that seem very convoluted and unnecessary.
    Can someone please provide me with an easy fix?

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2008] LinkButton - Submit on Enter

    It's the .click, .onclick thing. Because enter is not usual behavior for a link to submit a page, you're in convoluted territory. The reason is that it's ideal to have an imagebutton or button as something that performs a form submission, so you'll need the javascript fixes. For example

    http://kpumuk.info/asp-net/using-pan...ol-in-asp-net/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width