469,270 Members | 1,111 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

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

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
1 1709
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.

Similar topics

5 posts views Thread by http://links.i6networks.com | last post: by
2 posts views Thread by Cindy | last post: by
3 posts views Thread by PJ6 | last post: by
32 posts views Thread by Axel Bock | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.