Solved

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

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

617 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