Cancel button on [Enter] key press does not fire

G

gnewsgroup

A aspx page of mine contains a user control in a Panel control. This
user control has a textbox, a search button and a cancel button like
this:

[ txtSearchBox ] btnSearch btnCancel

When btnSearch is clicked, I show the search result right in the user
control. If btnCancel is clicked, the user control dissappears.

Everything works OK if I simply use mouse-clicks.

I have set the DefaultButton property of the panel to be btnSearch,
and the btnSearch's click event fires when the [Enter] key is pressed.

But, when I tab to btnCancel, and push the [Enter] key, it's still
btnSearch's click event that fires. Note that I can clearly see that
btnCancel is focused.

How can I fix this problem? I am using AJAX, and this Panel is inside
AJAX.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top