Click here to Skip to main content
15,911,360 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
When I clicked Enter key on Textbox in web application, my system will logout automatically.reply
Posted
Updated 27-Nov-16 20:11pm
Comments
ZurdoDev 1-Mar-12 7:49am    
Need more information. It sounds like your textbox maybe didn't actually have the focus and you have a logout button set as the default button in panel. These are just guesses since you haven't shared any of your code with us.

Without seeing code, I would guess that you have the log out button as the first element (top left). We have that problem when we have a button placed before the "find" button - which is usually the default button - in our "button menu". People will be using the form, press enter and all of a sudden be on a different page.

The way we fix is to either set the DefaultButton property in the panel that it's wrapped in, or the DefaultButton property on the form object.
 
Share this answer
 
Comments
PopeDarren 14-Aug-14 15:00pm    
What's with the down votes? It solved his problem.
I have faced same issue, which is resolved by implementing below code.

step1: add button control in your master page.

<asp:button id="btnDisableEnter" runat="server" text="" onclientclick="return false;" Style="display: none;" />

step 2: set default button in form tag in your master page.

<form id="form1" runat="server" defaultbutton="btnDisableEnter">


Step 3: Run your application and check your issue now.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900