Setting default button on dynamically loaded Web User Control

B

Ben Fidge

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
 
B

ben Fidge

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 said:
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


.
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top