Setting ImageButton as DefaultButton ASP.NET 2.0

Hello. I hope there is a more definitive answer than what I've been reading. I have an imagebutton on an ASP.NET form that I want to set as the default button (when the user presses ENTER). Does anybody have a solution for this?

Have you ever tested that? Image buttons cannot be set as the default button alone. They don't support IButtonControl. That is why I added Implements iButtonControl on the image button and then set it as the DefaultButton. In other words, I've already solved this issue.

To further clarify things, as of ASP.NET 2.0 you can set the DefaultButton property on the form object or on a panel object. So, for the example given in this thread, if you are in a masterpage/child page situation with the form being on the masterpage, you could create a panel object on your child page and set the default button on that panel. That way you do not need to modify the masterpage's form object in any way.
If you have multiple default buttons set (due to multiple panels), when the page postback is processed, the default will be determined by the context of the currently selected control.
for further details see: http://weblogs.asp.net/scottgu/archive/2005/08/04/421647.aspx

0

Featured Post

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method.
So in this a…

ASP.Net to Oracle Connectivity
Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers to develop an ASP.NET client…

This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes.
Assigning simple products to configurable: We assigned simple products…