Fire correct submit button when enter key is pressed in UserControl

Discussion in 'ASP .Net' started by Frank, Jan 13, 2005.

  1. Frank

    Frank Guest


    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

    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, Jan 13, 2005
    1. Advertisements

  2. Eliyahu Goldin, Jan 13, 2005
    1. Advertisements

  3. Frank

    Frank Dux Guest

    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 ?
    Frank Dux, Jan 13, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.