Solved

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

Posted on 2007-11-27
3
3,884 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
A short film showing how OnPage and Connectwise integration works.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

914 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now