Does defaultbutton of form tag works with ImageButton?

 Posted by Bhakti on 12/4/2009 | Category: ASP.NET Interview questions | Views: 4557
Answer:

No. It does not.
You need to handle such scenarios using code or JavaScript (This will be preferrable as defaultbutton doesn’t work also for FireFox)


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Virendradugar on: 12/4/2009
That's not true..

Image button can work as a default button.

Place a panel and inside panel place a image button. Set default button property of panel to the id of image button.And, it will work.


Kindly test it and modify your answer accordingly.
Posted by: Bhakti on: 12/4/2009
Hi Virendra,
Image button cant set as default button while its specified in form tag .
Kindly check from your end...
Your provided reply is work-around.

Thanks,
Bhakti Shah
Posted by: Virendradugar on: 12/4/2009
But your question does not say that it should only work with form tag. :)

As defaultbutton property exists for form also and panel also. You have to be specific for which control you are asking.

Thanks,
Virendra Dugar
Posted by: Bhakti on: 12/4/2009
Hi Virendra,

Question updated.

Thanks,
Bhakti Shah

Login to post response