Solved

Asp.net login control - Log in on Enter key press?

Posted on 2007-11-27
3
3,898 Views
Last Modified: 2013-11-07
Hi,

I thought that the default behaviour for the login control was to log in on the Enter Key press instead of clicking the Log In button but this isn't working for me.  The Login Control's LoggingIn event doesn't fire when the Enter key is pressed so the page just refreshes without logging in.  When I log in by clicking the button everything works fine.

Anyone know why this is happening?
0
Comment
Question by:fizzer666
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
TornadoV earned 500 total points
ID: 20359368
Here is what I had to do in order to make it work:

ImageButton buttonLogin = Login1.FindControl("LoginImageButton") as ImageButton;
Page.Master.Page.Form.DefaultButton = buttonLogin.UniqueID;

As you can see I'm using an imagebutton and master page, in any case,  you get the idea.

Hope this helps.
0
 
LVL 11

Expert Comment

by:TornadoV
ID: 20359379
Btw, that code goes inside of Page_Load.
0
 

Expert Comment

by:Sharalynn
ID: 20403085
btnLogin.UseSubmitBehaviour = True
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to order an IEnumerable in an ASPX page using VB.Net for the code behind 5 48
T-SQL and CLR parameter strings 9 57
c#, datatable, aspx 4 44
Web page design problem 3 37
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question