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

Setting default button on dynamically loaded Web User Control

P: n/a
Hi

I'm writing a web application where the entire site is
driven through a single page, and content is dynamically
loaded using Web UserControls. This is achieved by using
Page.LoadControl() from within the main page.

My Login UserControl has a "Login" button and I want that
to become the default button when the user presses
[Enter].

Currently, the LinkButton that the user clicks on to load
the Login UserControl retains the focus. After they've
entered their Username and Password, pressing [Enter]
fires the OnClick event for the above LinkButton, instead
of the UserControl's "Login" button.

How can I force the UserControls "Login" button's OnCLick
to fire when the user presses [Enter].

Thansk

Ben

Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Look at the following posts.

http://www.experts-exchange.com/Prog..._20944907.html

"Ben Fidge" <be*******@btopenworld.com> wrote in message
news:41****************************@phx.gbl...
Hi

I'm writing a web application where the entire site is
driven through a single page, and content is dynamically
loaded using Web UserControls. This is achieved by using
Page.LoadControl() from within the main page.

My Login UserControl has a "Login" button and I want that
to become the default button when the user presses
[Enter].

Currently, the LinkButton that the user clicks on to load
the Login UserControl retains the focus. After they've
entered their Username and Password, pressing [Enter]
fires the OnClick event for the above LinkButton, instead
of the UserControl's "Login" button.

How can I force the UserControls "Login" button's OnCLick
to fire when the user presses [Enter].

Thansk

Ben

Nov 18 '05 #2

P: n/a
Thanks for the reply. I had a quick look those posts
yesterday. If at all possible, I'd like to avoid
capturing the [Enter] keypress event if there's a
more "natural" way of doing it.

Thanks anyway :-)

Ben

-----Original Message-----
Look at the following posts.

http://www.experts- exchange.com/Programming/Programming_Languages/Dot_Net/Q_2
0944907.html
"Ben Fidge" <be*******@btopenworld.com> wrote in message
news:41****************************@phx.gbl...
Hi

I'm writing a web application where the entire site is
driven through a single page, and content is dynamically loaded using Web UserControls. This is achieved by using Page.LoadControl() from within the main page.

My Login UserControl has a "Login" button and I want that to become the default button when the user presses
[Enter].

Currently, the LinkButton that the user clicks on to load the Login UserControl retains the focus. After they've
entered their Username and Password, pressing [Enter]
fires the OnClick event for the above LinkButton, instead of the UserControl's "Login" button.

How can I force the UserControls "Login" button's OnCLick to fire when the user presses [Enter].

Thansk

Ben

.

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.