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

  • Thread starter Thread starter Gill Smith
  • Start date Start date
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
 
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)
 
Back
Top