By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,510 Members | 1,821 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,510 IT Pros & Developers. It's quick & easy.

Fire correct submit button when enter key is pressed in UserControl

P: n/a
Hi!

I have a really 'simple' problem. I have an .aspx page with 2
textboxes (login & password) and a Submit button. This works very
well, i fill in my login and password and simply press the enter key
and the form submits and the Button_Click event on the .aspx page is
triggered.

Now i also have a usercontrol (.ascx) wich include 1 texbox and also
an submit button. Now comes the problem. The page displays correct,
BUT when i fill in my email in the UserControl and press the enter key
the page submits but the Button_Click on the .aspx page is triggered
instead off the Button_Click in the usercontrol !! *aaargh*.

Is there a nice sollution that works with almost every browser (also
some older flavors), if there is a nice sollution anyways...

Hope you can help me out,
Frank
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Frank,

This should help you.

http://www.allasp.net/enterkey.aspx

Eliyahu

"Frank" <fr***@hubhop.com> wrote in message
news:6c**************************@posting.google.c om...
Hi!

I have a really 'simple' problem. I have an .aspx page with 2
textboxes (login & password) and a Submit button. This works very
well, i fill in my login and password and simply press the enter key
and the form submits and the Button_Click event on the .aspx page is
triggered.

Now i also have a usercontrol (.ascx) wich include 1 texbox and also
an submit button. Now comes the problem. The page displays correct,
BUT when i fill in my email in the UserControl and press the enter key
the page submits but the Button_Click on the .aspx page is triggered
instead off the Button_Click in the usercontrol !! *aaargh*.

Is there a nice sollution that works with almost every browser (also
some older flavors), if there is a nice sollution anyways...

Hope you can help me out,
Frank

Nov 19 '05 #2

P: n/a
Hi Eliyahu,

Thanks for the quick reply. I looked at the given url but, like already
stated in the article, it is rather un-elegant. Isn't there any other
cleaner way ?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.