Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set focus to an Agp Label?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Can anyone tell me how to set the focus to a label after the page has loaded? I am trying to set an error message on a label and set the focus to it or a text field next to it.

Thanks,
Alex
 
You can do it via javascript: Page.controlname.focus();

use the following command on the server-side (will get executed onload of the page:

writeScript("Page.Field1.focus();");

Of course, change Field1 to the name of your text field in question.

Regards,

Collins (cdeloach@cdiemgroup.com)
 
I have found that you can only set the focus to form fields on a page.


Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top