473,405 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Fire correct submit button when enter key is pressed in UserControl

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
2 2040
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
5
by: http://links.i6networks.com | last post by:
I want to force the users to click submit to submit the forms. How do I disable "Enter Key" which will submit the form automatically when they entered the data in text field then pressed "enter key"
7
by: Derrick | last post by:
Didn't there used to be some property where you could set a button to be the "default" so that if a user pressed enter with any control in focus, the button would still get the click event? Some...
11
by: Sandra Castellanos | last post by:
Hello, I want to know what I have to do to make the enter key to submit forms. I read in another newsgroup that inserting an html hidden text box made the trick, and it actually does, but in my...
5
by: Girish | last post by:
I have TWO submit buttons of type IMAGE on my asp form. This renders as <input type="image">. I need to be able to eble the ENTER button for both buttons. Yes, I know that for the input type...
4
by: sowencheung | last post by:
Hi, all The scenario is like this: I have a master page, contains two user controls, one is a search control, another is a login control. The server-side <form> is in the master page,...
3
by: David Lozzi | last post by:
Howdy, I'm using asp.net 2.0 and am trying to get one text box on the page, after the user presses enter, to "click" a specific button. I copied the javascript I used for a .net 1.1 web app I...
9
by: learning | last post by:
Hi! Here's my situation: I have one textfield with one 'submit' button in PAGE1.PHP. When I click on the 'submit' button I am sent to PAGE2.PHP where I have a "switch" routine that checks...
0
by: thersitz | last post by:
Hi, Using aspnet3.5,VStudio 2008, VB 1.) I have a set of pages, with a search text box button within a userControl that searches across our websites and is registered in a masterpage. 2)...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.