Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Buttons don't work with Enter button 1

Status
Not open for further replies.

thehms

Programmer
Jul 3, 2003
58
0
0
AE
hello all...

i have a form (say a login form), after the user enters his login information he presses enter to login. the form doesnt take this enter as a click on the button, instead, it just posts back the page. for a person to successfully login he has to press on ENTER button with the mouse.

i searched a lot and i found a line of code (which i cant find now!) that ppl said u should add in the code behind. but it still didnt work....

anyone has any ideas?

thanx :)
TheHMS
 
The line of code you found may have been:
Code:
Page.RegisterHiddenField("__EVENTTARGET", "Button1")
and this worked in a simple example I created.


----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
hello...

yes, this is the line of code i found...it worked when i hvae the buttons on a page...

but my problme lies in that my form is in a user control..

i added the code in the ascx.cs file and it didnt work, and i added it also in the code behind of the file i call it on and it also didnt work...

any ideas... ??

TheHMS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top