Problems with Default button behaviour in VS 2005

E

Evert

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top