Problems with Default button behaviour in VS 2005

Discussion in 'ASP .Net Web Controls' started by Evert, Jun 26, 2006.

  1. Evert

    Evert Guest

    I have a page which contains an Email textbox having two validators, one
    checks if a value is entered and one which checks if the email address is
    valid.
    The page also has a button (for sending a mail) which I have made a default
    button.

    The page has a masterpage containing 3 imagebuttons.

    Now I have a strange problem when I press Enter the first time (with email
    address empty or containing an illegal address) everything works fine (email
    validators notify of errors).

    No when I press enter the second time (correcting nothing, leaving
    everything as it was), one of the imagebuttons of the masterpage is fired.

    Other options I tried without luck:

    1
    HtmlForm masterForm = (HtmlForm)Master.FindControl("masterForm");
    masterForm.DefaultButton = sendImageButton.UniqueID;

    2
    Page.Form.DefaultButton = sendImageButton.UniqueID;


    Thanks for any suggestions/help

    Evert
    Evert, Jun 26, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Flip
    Replies:
    2
    Views:
    8,308
    Saravana
    Nov 18, 2004
  2. Andrew Crowe
    Replies:
    2
    Views:
    16,254
    Jukka K. Korpela
    Feb 6, 2004
  3. AlecL
    Replies:
    2
    Views:
    807
    Alexey Smirnov
    Feb 12, 2007
  4. Andy Chambers
    Replies:
    1
    Views:
    374
    Daniel Dyer
    May 14, 2007
  5. Suzanne

    Problems with Link Button and Button web controls

    Suzanne, Dec 3, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    148
    Suzanne
    Dec 3, 2003
Loading...

Share This Page