954,577 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problem With Image Button

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

DanielPartridge
Newbie Poster
2 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
 

hi,

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

greeny_1984
Posting Whiz
372 posts since Apr 2007
Reputation Points: 25
Solved Threads: 29
 

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.

hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
 

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!

DanielPartridge
Newbie Poster
2 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
 

good :)

BzzBee
Posting Whiz
327 posts since Apr 2009
Reputation Points: 16
Solved Threads: 48
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You