How to set focus on TextBox web control for the clicked event of ImageButton.

G

Gill Smith

when the page is loaded I am using onload event at the client side and
setting the focus on the control(TextBox). However when the user clicks on
Clear ImageButton, I am clearing all the text boxes and the grid(previous
search result display) in the clicked event of the ImageButton at the server
side. How to set the focus on the TextBox again when the user clicks on the
Clear button.
-Gill
 
T

Teemu Keiski

Hi,

you could use (generally) Andy Smith's FirstFocus control to set focus to
the desired TextBox..
http://www.metabuilders.com/Tools/FirstFocus.aspx

Certainly you need to know to which TextBox you set the focus on (you can
store the ID to hidden filed which you read just before clearing the form,
and then reset the focus after form is cleared)
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top