Using Panel.DefaultButton property with LinkButton control in ASP.NET

ASP.NET has great limitation — only one server form on the page. Even if you are developing complex page, which looks like several forms with different submit buttons, in fact you have only one form.

So we have a problem:

How browser understanding which button should be triggered when user pressed ENTER?

It uses first Button control (usually that’s wrong), and if you have LinkButton’s, they would never be triggered.

In ASP.NET 2.0 new property has been added to the Panel  and HtmlForm controls — DefaultButton, which can be used to specify ID of the control, which implements IButtonControl  interface (usually Button and LinkButton). This button control would be triggered when user pressed ENTER.

But there is one big problem exist:

LinkButton control would not be triggered in Firefox on ENTER.

In this article I will show why this problem take place and how to solve it.

Read the full article here

Hope this helps !!!

Jay Ganesh


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s