Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4617840
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:10:53+00:00 2026-05-22T02:10:53+00:00

I must have read a hundred forum and blogposts about this, all talking about

  • 0

I must have read a hundred forum and blogposts about this, all talking about placing a Panel and setting the Default button to the Login button, or setting the Default button in the Form. I’ve tried all this plus lots more, but nothing works.

I have two LinkButtons in my Login control, which is converted to a template. The first is the Login button, the second is a link to a register page. When I hit enter, the Register LinkButton fires and redirects to the register page.

I’ve tried setting the default button on panels and placing them everywhere and setting the default button in the Form tag itself. I tried removing the Register button and setting an onclick on the and calling a function that redirected to the register page. That didn’t even work, and the enter key still redirected to the register page.

They are placed in the LayoutTemplate like this:

<div class="btn-login">
                                        <asp:LinkButton ID="LoginButton" runat="server" CommandName="Login" ValidationGroup="LoginUserValidationGroup"
                                            Height="38px" Width="120px">
                                        </asp:LinkButton>
                                    </div>
                                    <div class="btn-opretbruger">
                                        <asp:LinkButton ID="Register" runat="server" ValidationGroup="LoginUserValidationGroup"
                                            Height="38px" Width="120px" PostBackUrl="/Account/registrerbruger.aspx">
                                        </asp:LinkButton>

                                    </div>

All the articles I have read used Button controls, and I use a LinkButton.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:10:54+00:00Added an answer on May 22, 2026 at 2:10 am

    Task 1)

    Add some scrip to your page to disable the enter key…

    function stopRKey(evt) {
    
        var evt = (evt) ? evt : ((event) ? event : null);
        var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);    
        if ((evt.keyCode == 13) && (node.type == "text")) { return false; }
    }
    

    Task 2)

    Add some script that allows you to target a html element and raise the event handler for it

    function submitByTarget(event, target) {
    
        if (event.keyCode == 13) {
    
            jQuery('#' + target.id).click();
    
        }
    
    }
    

    Task 3)

    Add an event handler for your login txtbox that waits for the enter key to be hit and raises the correct .click handler for the target button…in this case ‘login’

    txtLogin.Attributes.Add("onkeypress", "return submitByTarget(event," + btnSearch.ClientID + ");");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read all the questions regarding this. They all say I must click
First, I must say that I have read several post about this at StackOverflow
I must have read about arguments in functions and how they are variables and/or
Good day folks I must have read about 20 different articles/approaches about how to
I have read on MSDN( see Important note ) that RSACryptoServiceProvider must be disposed.
This must have an obvious solution, but I'm stumped. We are developing an application
I must have pressed on the wrong button at some point, and now when
I must have overlooked something completely obvious?? but my button displays its image and
you must have seen this piece of code somewhere else too,but obviously there's no
I have read in HttpServlet documentation that A subclass of HttpServlet must override at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.