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

Recommended Answers

All 4 Replies

hi,

you can place the image ina updata panel and set default button to the image button.

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!

good :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.