Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Cancel button on [Enter] key press does not fire

Thread Tools

Cancel button on [Enter] key press does not fire

Posts: n/a
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

[ 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

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView update and cancel buttons fire RowCommand with Edit button as CommandSource Marco Liedekerken ASP .Net Datagrid Control 0 11-08-2006 12:17 PM
Press enter fire specific button in form in ASP.Net 2 David Lozzi ASP .Net 3 10-25-2006 02:51 PM
Button OnClick does not fire on first postback, but does on second Janet Collins ASP .Net 0 01-13-2006 10:08 PM
HELP CANCEL CANCEL CANCEL Carmen Rosario Computer Support 7 04-06-2005 11:04 PM
Permission failure on save/cancel button press =?Utf-8?B?TmlnZWwgUml2ZXR0?= ASP .Net 0 06-17-2004 10:33 AM