Problem With Image Button

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Apr 2009
Posts: 2
Reputation: DanielPartridge is an unknown quantity at this point 
Solved Threads: 0
DanielPartridge DanielPartridge is offline Offline
Newbie Poster

Problem With Image Button

 
0
  #1
Apr 3rd, 2009
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
Last edited by DanielPartridge; Apr 3rd, 2009 at 5:53 am.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 370
Reputation: greeny_1984 is an unknown quantity at this point 
Solved Threads: 29
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz

Re: Problem With Image Button

 
0
  #2
Apr 3rd, 2009
hi,

you can place the image ina updata panel and set default button to the image button.
If u r query is achieved,mark the thread as solved

Live and Let Live
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: Problem With Image Button

 
0
  #3
Apr 3rd, 2009
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.
Last edited by hollystyles; Apr 3rd, 2009 at 9:34 am.
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 2
Reputation: DanielPartridge is an unknown quantity at this point 
Solved Threads: 0
DanielPartridge DanielPartridge is offline Offline
Newbie Poster

Re: Problem With Image Button

 
0
  #4
Apr 3rd, 2009
Originally Posted by hollystyles View Post
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!
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 254
Reputation: BzzBee is an unknown quantity at this point 
Solved Threads: 37
BzzBee BzzBee is offline Offline
Posting Whiz in Training

Re: Problem With Image Button

 
0
  #5
Apr 3rd, 2009
good
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC