Click here to Skip to main content
15,902,817 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a problem,
After typing in TextBox, I press Enter key.
The problem is post back to another page.
Please Explain me!
Posted

See following article. It discusses what you want to achieve.
http://www.beansoftware.com/ASP.NET-Tutorials/Accept-Enter-Key.aspx[^]
 
Share this answer
 
Enter key is default click event fire key. Try to use mouse click or disable Enter key to fire event by code(JavaScript/C#/VB.net etc).
 
Share this answer
 
hi,

it comes due to the default behaviour.

To prevent the enter button event use this on the onkeydown javascript function from the body

use these code inside the javascript function
C#
if (window.event.keyCode == 13)
{
    event.returnValue=false;
    event.cancel = true;
}


regards,
shefeek
 
Share this answer
 
Thank you So Much! I'll try it :P .
 
Share this answer
 

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