By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,493 Members | 1,138 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,493 IT Pros & Developers. It's quick & easy.

controlling "return key" behavior with multiple "form-elements"

P: n/a
Hi there,

we have an application which is built with several ASCX controls some of
which contain form elements (e.g. Textboxes, Buttons etc.)

For example: in the top section (one ascx-control), there is a
textbutton in which the user can enter a string to search for. There's
link button right next to that textbutton. Then, in the "content
section" (another ascx-control), there may be a login-dialog which
prompts the user for login-name and password, with another button "Login".

How can we make sure that when the user has entered his login data and
enters "return" (instead of clicking the button), the event handler of
the button is fired instead of firing the event handler of the
search-button? And vice versa: when the user has entered a search string
in the search-textbox and enters "return", how can we make sure this
"search-button" event handler is fired instead of any other "subforms"
event handler.

We cannot have multiple forms as only one form is allowed per ASPX page
(even when distributed among severy ascx-controls).

kind regards,
david
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
This might be helpful:
http://www.allasp.net/enterkey.aspx

Karl

"Holger (David) Wagner" <da***@purple-sunshine.de> wrote in message
news:cf**********@svr7.m-online.net...
Hi there,

we have an application which is built with several ASCX controls some of
which contain form elements (e.g. Textboxes, Buttons etc.)

For example: in the top section (one ascx-control), there is a
textbutton in which the user can enter a string to search for. There's
link button right next to that textbutton. Then, in the "content
section" (another ascx-control), there may be a login-dialog which
prompts the user for login-name and password, with another button "Login".

How can we make sure that when the user has entered his login data and
enters "return" (instead of clicking the button), the event handler of
the button is fired instead of firing the event handler of the
search-button? And vice versa: when the user has entered a search string
in the search-textbox and enters "return", how can we make sure this
"search-button" event handler is fired instead of any other "subforms"
event handler.

We cannot have multiple forms as only one form is allowed per ASPX page
(even when distributed among severy ascx-controls).

kind regards,
david

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.