Solved

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

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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

728 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