This may be a simple solution but I cant seem to find it anywhere!

Basically I have just added an imagebutton to My masterpage I have just realised that on my login page i type in the credentials and hit enter however this triggers the image button click event and goes to the homepage.

If there is anyway to disable this I would very much appreciate it

If you require more info please let me no

Thank you in advance

Daniel

greeny_1984: Well that would just exhibit the same behaviour as whats currently happening. But you're on the right track.

Image buttons are rendered as type="submit" which means when you press the enter key it is assumed you are submitting. This is an HTMl Forms standard thing.

You need to place your credentials controls in an asp:Panel and set the DefaultButton attribute of the panel to the save button ID for your form.

greeny_1984: Well that would just exhibit the same behaviour as whats currently happening. But you're on the right track.

Image buttons are rendered as type="submit" which means when you press the enter key it is assumed you are submitting. This is an HTMl Forms standard thing.

You need to place your credentials controls in an asp: Panel and set the DefaultButton attribute of the panel to the save button ID for your form.

That is brilliant such a simple solution thank you very much!

This question has already been answered. Start a new discussion instead.